问题:在程序中如何删除某个目录下的文件?

解决方案 »

  1.   

    CFile file;
    file.ReMove(CString FileFullPath);
    //FileFullPath:删除的文件的全路经
      

  2.   

    定义:
    BOOL DeleteFile(
      LPCTSTR lpFileName   // file name
    );
    例子:
    DeleteFile("e:\\a.txt");
      

  3.   

    定义:
    BOOL DeleteFile(
      LPCTSTR lpFileName   // file name
    );
    例子:
    DeleteFile("e:\\a.txt");
      

  4.   

    DeleteFile
    The DeleteFile function deletes an existing file. BOOL DeleteFile(
      LPCTSTR lpFileName   // pointer to name of file to delete
    );
     
    Parameters
    lpFileName 
    Pointer to a null-terminated string that specifies the file to be deleted. 
    Return Values
    If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError.