Registriert seit: 6. Apr 2005
10.109 Beiträge
|
Re: FTP Client
11. Aug 2005, 07:01
Klar doch.
Delphi-Quellcode:
procedure TDemoForm.ListButtonClick(Sender: TObject);
var
l: TIdFtpListItems;
i: integer;
sl: TStringList;
begin
sl := TStringList.Create; // create raw data container
idFTP.Connect(true, -1); // login
idFTP.List(sl, '*', true); // get all entries with details
l := idFTP.DirectoryListing; // get ref of parsed entries
for i := l.Count - 1 downto 0 do // start on safe side
if l[i].ItemType = ditDirectory // check for sub directories
then sl[i] := l[i].FileName // keep dir entries
else sl.Delete(i); // drop other entries
idFTP.Disconnect; // logout
// ListBox.Items.Assign(sl); // show directory names
sl.Free; // drop raw data container
end;
marabu
PS: Indy 9
|
|
Zitat
|