Thema: Delphi FTP Client

Einzelnen Beitrag anzeigen

marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 

Re: FTP Client

  Alt 11. Aug 2005, 08: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
  Mit Zitat antworten Zitat