unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPServer, IdFTPServer, IdFTPList, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
IdFTPServer1: TIdFTPServer;
procedure IdFTPServer1UserLogin(ASender: TIdFTPServerThread;
const AUsername, APassword:
String;
var AAuthenticated: Boolean);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure IdFTPServer1ListDirectory(ASender: TIdFTPServerThread;
const APath:
String; ADirectoryListing: TIdFTPListItems);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IdFTPServer1UserLogin(ASender: TIdFTPServerThread;
const AUsername, APassword:
String;
var AAuthenticated: Boolean);
begin
AAuthenticated := ( AUsername = '
myuser' )
and ( APassword = '
mypass' ) ;
if not AAuthenticated
then
exit;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IdFTPServer1.active := true;
// an
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IdFTPServer1.active := false;
// aus
end;
procedure TForm1.IdFTPServer1ListDirectory(ASender: TIdFTPServerThread;
const APath:
String; ADirectoryListing: TIdFTPListItems);
begin
ASender.HomeDir := '
C:\*'; <<<<<--------hier muss ein Fehler sein
asender.currentdir := '
C:\*'; <<<<<--------hier muss ein Fehler sein
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
end.