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 False면 무조건
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists False면 무조건
); // 복사 True면 같은이름의 NewFile이존재하면 실패
procedure TForm1.Button5Click(Sender: TObject);
begin
if saveDlg.Execute then
begin
if CopyFile(pchar(lbFile.Caption), pchar(saveDlg.FileName), True) then
ShowMessage('파일복사성공')
else
ShowMessage('파일복사실패');
end;
end;