遇到问题,要养成先查查帮助的习惯
The CopyFile function copies an existing file to a new file.
BOOL CopyFile(
LPCTSTR lpExistingFileName, // address of name of an existing file
LPCTSTR lpNewFileName, // address of filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
Parameters
lpExistingFileName
Points to a null-terminated string that specifies the name of an existing file.
lpNewFileName
Points to a null-terminated string that specifies the name of the new file.
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as
that specified by lpNewFileName already exists. If this parameter is TRUE
and the new file already exists, the function fails. If this parameter is
FALSE and the new file already exists, the function overwrites the existing
file and succeeds.
Return Value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To get extended error
information, call GetLastError.