VC++ CopyFile函数用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/mao0514/article/details/89011274

BOOL CopyFile( 

LPCTSTR lpExistingFileName, // pointer to name of an existing file 
LPCTSTR lpNewFileName, // pointer to filename to copy to 
BOOL bFailIfExists // flag for operation if file exists 
); 
其中各参数的意义: 
LPCTSTR lpExistingFileName, // 你要拷贝的源文件名 
LPCTSTR lpNewFileName, // 你要拷贝的目标文件名 
BOOL bFailIfExists // 如果目标已经存在,不拷贝(True)并返回False,覆盖目标(false) 

如: 
//拷贝文件c:\log.txt到d:\log.txt,如果D:\log.txt已经存在,就覆盖 
CopyFile("c:\\log.txt","d:\\log.txt",false);  
 

猜你喜欢

转载自blog.csdn.net/mao0514/article/details/89011274