你的答案让我满意可以再加分

解决方案 »

  1.   

    新建一个文件夹,把原来文件夹的所有文件move到 新的目录下。
    delete old 文件夹。
      

  2.   

    以我所知, 一般的OS都不提供改名的功能, 但一般也能用MoveFile去取代Rename.
    MoveFile("Source.file", "Destination.file");
      

  3.   

    看没看过windows如何改名的?它的方法决不是这样,我坚信。
    反问:如果这个文件夹中内容很多(100G),你还这么做么?
      

  4.   

    Following information comes from MSDN:rename, _wrename
    Rename a file or directory.int rename( const char *oldname, const char *newname );
    int _wrename( const wchar_t *oldname, const wchar_t *newname );
      

  5.   

    SHFILEOPSTRUCT
    Contains information that the SHFileOperation function uses to perform file operations. typedef struct _SHFILEOPSTRUCT{ 
        HWND hwnd; 
        UINT wFunc; 
        LPCTSTR pFrom; 
        LPCTSTR pTo; 
        FILEOP_FLAGS fFlags; 
        BOOL fAnyOperationsAborted; 
        LPVOID hNameMappings; 
        LPCTSTR lpszProgressTitle; 
    } SHFILEOPSTRUCT, *LPSHFILEOPSTRUCT;
     
    Members
    hwnd 
    Window handle to the dialog box to display information about the status of the file operation. 
    wFunc 
    Value that indicates which operation to perform. This member can be one of the following values: 
    FO_COPY 
    Copy the files specified in the pFrom member to the location specified in the pTo member. 
    FO_DELETE 
    Delete the files specified in pFrom. 
    FO_MOVE 
    Move the files specified in pFrom to the location specified in pTo. 
    FO_RENAME 
    Rename the file specified in pFrom. You cannot use this flag to rename multiple files with a single function call. Use FO_MOVE instead.