unit Office_Clipper;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MyFTP, ExtCtrls, JvExControls, JvXPCore, JvXPButtons, JvLED, StdCtrls;
type
TForm1 =
class(TForm)
ConnectButton: TJvXPButton;
updatetimer: TTimer;
Connectedled: TJvLED;
FileBox: TListBox;
procedure updatetimerTimer(Sender: TObject);
procedure ConnectButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
connected: boolean;
ftp: TMyFTP;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
ftp := TMyFTP.create;
ftp.set_host('
myserver.de');
ftp.set_user('
myuser');
ftp.set_password('
mypassword');
end;
procedure TForm1.ConnectButtonClick(Sender: TObject);
begin
if ftp.connect = false
then
showmessage('
Fehler beim Erstellen der Verbindung!')
else
begin
ftp.set_directory('
mydirectory');
updatetimer.Enabled := true;
end;
end;
procedure TForm1.updatetimerTimer(Sender: TObject);
begin
connected :=
ftp.get_state;
if connected = true
then
begin
ConnectedLED.Status := true;
ConnectedLED.Active := false;
ftp.get_list(FileBox);
end
else
begin
ConnectedLED.Status := false;
ConnectedLED.Active := true;
end;
end;
end.