unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP;
type
TForm3 = class(TForm)
Label1: TLabel;
Button1: TButton;
Button2: TButton;
IdHTTP1: TIdHTTP;
Edit1: TEdit;
SaveDialog1: TSaveDialog;
Button3: TButton;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure Edit2Enter(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Speicherort, Form3: TForm3;
implementation
uses
unit2, unit1, Filectrl;
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
var ResponseStream: TFileStream;
begin
ResponseStream := TFileStream.Create(Edit1.Text, fmCreate);
try
idHTTP1.Get(
url, ResponseStream);
finally
ResponseStream.Free;
end;
ShowMessage('Download abgeschlossen');
end;
procedure TForm3.Button3Click(Sender: TObject);
var dir : String;
begin
dir := ExtractFilePath(Application.ExeName);
if SelectDirectory ('Bitte ein Verzeichnis auswählen','',Dir)
then
edit1.Text := (dir);
end;
procedure TForm3.Edit2Enter(Sender: TObject);
begin
Edit2.Text := '';
end;
end.