unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls, Filectrl,
Vcl.ExtCtrls,
Vcl.ComCtrls;
type
TForm1 =
class(TForm)
Panel1: TPanel;
Edit1: TEdit;
Label1: TLabel;
Button2: TButton;
Panel2: TPanel;
Edit2: TEdit;
Label2: TLabel;
Panel3: TPanel;
Button3: TButton;
Button4: TButton;
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
zaehler: integer =1;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
var
Dir:
String;
begin
SelectDirectory('
Verzeichnispfad wählen', '
', Dir);
ShowMessage(Dir);
Edit1.Text := (Dir);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
Dir:
String;
begin
SelectDirectory('
Verzeichnispfad wählen', '
', Dir);
ShowMessage(Dir);
Edit2.Text := (Dir);
end;
procedure TForm1.Button4Click(Sender: TObject);
var
mem : TMemoryStream;
FilePathA, FilePathB :
string;
i:integer;
begin
inc(zaehler);
FilePathA := Edit1.Text + (ParamStr(i))+ '
*.asc';;
// Pfad der zu kopierenden Datei
FilePathB := Edit2.Text + (ParamStr(i)) +(FormatDateTime('
yymmdd',now))+(Format('
%.4d',[zaehler]) + '
.asc');
// Zielpfad
mem := TMemoryStream.Create;
try
mem.LoadFromFile(filePathA);
mem.SaveToFile(FilepathB);
finally
mem.Free;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
end;
end.