unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdFTP, StdCtrls, ComCtrls, IdAntiFreezeBase, IdAntiFreeze, XPMan,
ExtCtrls;
type
TForm1 =
class(TForm)
connect: TButton;
IdFTP1: TIdFTP;
Edit1: TEdit;
desconnect: TButton;
wobinich: TButton;
Edit2: TEdit;
dirchange: TButton;
back: TButton;
XPManifest1: TXPManifest;
IdAntiFreeze1: TIdAntiFreeze;
LabeledEdit1: TLabeledEdit;
LabeledEdit2: TLabeledEdit;
LabeledEdit3: TLabeledEdit;
ListBox1: TListBox;
procedure connectClick(Sender: TObject);
procedure desconnectClick(Sender: TObject);
procedure wobinichClick(Sender: TObject);
procedure dirchangeClick(Sender: TObject);
procedure backClick(Sender: TObject);
procedure ListBox1DblClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
function IsFile(Filename :
String) : Boolean;
var
IsFile: Boolean;
begin
if FileExists(<Filename>)
then
begin
isFile := true;
end
else
begin
isFile := false;
end;
end;
{$R *.dfm}
procedure TForm1.connectClick(Sender: TObject);
begin
IdFTP1.username := LabeledEdit2.Text;
IdFTP1.Password := LabeledEdit3.Text;
IdFTP1.Host := LabeledEdit1.Text;
IdFTP1.Connect;
if idFTP1.Connected
then
Edit1.Text:='
Verbunden';
idftp1.list(listbox1.items,'
',false);
end;
procedure TForm1.desconnectClick(Sender: TObject);
begin
IdFTP1.Disconnect;
edit1.Text := '
Getrennt';
end;
procedure TForm1.wobinichClick(Sender: TObject);
begin
idftp1.list(listbox1.items,'
',false);
//IdFTP1.List(Memo1.Lines);
end;
procedure TForm1.dirchangeClick(Sender: TObject);
begin
IdFTP1.ChangeDir(Edit2.Text);
idftp1.list(listbox1.items,'
',false);
end;
procedure TForm1.backClick(Sender: TObject);
begin
IdFTP1.ChangeDir('
..');
idftp1.list(listbox1.items,'
',false);
end;
procedure TForm1.ListBox1DblClick(Sender: TObject);
begin
if Listbox1.ItemIndex <> - 1
then
begin
if isFile := True
then
begin
IDFTP1.ChangeDir(Listbox1.Items[Listbox1.ItemIndex]);
idftp1.list(listbox1.items,'
',false);
end;
end;
end.
end.