VC++ CopyFile函數用法

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);  
發佈了10 篇原創文章 · 獲贊 8 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章