hab es nun folgendermaßen, sehr umständlich hinbekommen:
Delphi-Quellcode:
procedure ListDir(aDir: string);
var
aItem: TIdFTPListItems;
i: Integer;
begin
Form1.IdFTP1.ChangeDir(aDir);
Form1.IdFTP1.List;
aItem := Form1.IdFTP1.DirectoryListing;
for i := aItem.Count - 1 downto 0 do
begin
if (aItem.Items[i].FileName = '.') or (aItem.Items[i].FileName = '..') then
aItem.Delete(i);
end;
if aItem.Count = 0 then
Form1.Memo1.Lines.Add(Form1.IdFTP1.RetrieveCurrentDir + '/')
else
begin
for i := 0 to aItem.Count - 1 do
begin
Application.ProcessMessages;
with aItem.Items[i] do
begin
if ItemType = ditDirectory then
ListDir(aItem.Items[i].FileName)
else
Form1.Memo1.Lines.Add(Form1.IdFTP1.RetrieveCurrentDir + '/' + FileName);
end;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Clear;
ListDir('/_test/');
end;