unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdFTP, ExtCtrls, Buttons;
type
TForm1 = class(TForm)
IdFTP1: TIdFTP;
SpeedButton1: TSpeedButton;
Panel1: TPanel;
procedure SpeedButton1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
ftp : TidFTP;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
try
ftp.Username := 'gene2';
ftp.Password := '****';
ftp.Port := 21;
ftp.Host := 'gene2.ge.funpic.de';
except
ShowMessage('Could not set Data');
end;
try
ftp.Connect;
except
ShowMessage('Could not connect');
end;
try
ftp.Put('upload.txt', 'upload.txt');
except
ShowMessage('Could not upload');
end;
ftp.Disconnect;
end;
end.