procedure TForm1.Button1Click(Sender: TObject);
var
sFromFileName,sToFileName: AnsiString;
begin
sFromFileName:='d:/temp/test.txt';
sToFileName:='d:/12.txt';
if CopyFile(PChar(sFromFileName),PChar(sToFileName),false) then
ShowMessage('文件复制完成!')
else
ShowMessage('文件复制发生错误:'+IntToStr(GetLastError));
end;