WinAPI: CopyFile - 复制文件
2020-11-24 01:07
标签:style color c strong string 文件 WinAPI: CopyFile - 复制文件,搜素材,soscw.com WinAPI: CopyFile - 复制文件 标签:style color c strong string 文件 原文地址:http://www.cnblogs.com/azhqiang/p/3716364.html//声明:
CopyFile(
lpExistingFileName: PChar; {源文件}
lpNewFileName: PChar; {目标文件}
bFailIfExists: BOOL {如果目标文件存在, True: 失败; False: 覆盖}
): BOOL;
//例1:
begin
CopyFile(‘c:\BOOTLOG.TXT‘, ‘c:\temp\BOOTLOG.TXT‘, True);
end;
//例2:
var
ExistFile, NewFile: string;
begin
ExistFile := ‘c:\BOOTLOG.TXT‘;
NewFile := ‘c:\temp\BOOTLOG.TXT‘;
if CopyFile(PChar(ExistFile), PChar(NewFile), True) then
ShowMessage(‘复制成功‘);
end;