您的位置:首页 > 其它

VC实现文件的拷贝移动

2010-05-28 15:42 330 查看
BOOL CopyFile(
LPCTSTR lpExistingFileName,
  LPCTSTR lpNewFileName,
  BOOL bFailIfExists);
lpExistingFileName [in] Pointer to a null-terminated string that specifies the name of an existing file. In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "//?/" to the path. For more information, see Naming a File.
Windows Me/98/95:  This string must not exceed MAX_PATH characters.lpNewFileName [in] Pointer to a null-terminated string that specifies the name of the new file. In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "//?/" to the path. For more information, see Naming a File.
Windows Me/98/95:  This string must not exceed MAX_PATH characters.bFailIfExists [in] If this parameter is TRUE and the new file specified by lpNewFileName already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.  
 
 
该函数可以显示文件以及文件夹的整体拷贝和移动,例子如下:
 
CopyFile(_T("E://01.bmp"),_T("F://01.bmp"),FALSE );
 
把E盘的拷贝并移动到F盘
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  function string path file