Delphi FileOperations Copy,Move,Delete


SUBMITTED BY: kendiboy

DATE: Dec. 22, 2017, 2:58 a.m.

FORMAT: Delphi

SIZE: 589 Bytes

HITS: 568

  1. procedure TForm1.operations(Sender: TObject);
  2. begin
  3. try
  4. { Copy file from source file path to destination file path }
  5. if Sender = btnCopy then
  6. TFile.Copy(edSourcePath.Text, edDestinationPath.Text);
  7. { Move file from source file path to destination file path }
  8. if Sender = btnMove then
  9. TFile.Move(edSourcePath.Text, edDestinationPath.Text);
  10. { Delete file from source file path }
  11. if Sender = btnDelete then
  12. TFile.Delete(edSourcePath.Text);
  13. except
  14. MessageDlg('Incorrect path', mtError, [mbOK], 0);
  15. Exit;
  16. end;
  17. end;

comments powered by Disqus