首页 > 代码库 > C++ CopyFile

C++ CopyFile

 

复制文件

 

关键点

CopyFile

The CopyFile function copies an existing file to a new file.

The CopyFileEx function provides two additional capabilities. CopyFileEx can call a specified callback function each time a portion of the copy operation is completed, and CopyFileEx can be canceled during the copy operation.

BOOL CopyFile(

  LPCTSTR lpExistingFileName,// name of an existing file

  LPCTSTR lpNewFileName,     // name of new file

  BOOL bFailIfExists          // operation if file exists

);

 

实现过程

 

if (::CopyFile("C:\\1.txt","D:\\2.txt",TRUE))
    MessageBox("Copy OK!");
else
    MessageBox("Copy Faild!");

 

 

   


 

备注

 

 

相关链接

                           

 

 


来自为知笔记(Wiz)