Autor Beitrag
Millo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Mo 21.10.02 09:25 
Moin

Ich verwende die idFTP Komponente und wil jetzt alle Dateien und Ordner auflisten.
Mein Problem ist ich greife über IdFTP1.List auf die Informationen des Ordners zu, kann jetzt aber nicht veststellen was ein ordner und was eine Datei ist um die Ordner Seperat in einm TreeView anzuzeigen.
Millo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Mo 21.10.02 10:50 
Sorry,
hab das Problem schon selbst gelöst!
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 21.10.02 12:36 
Hi Millo,

und wie hast Du es gelöst?

Gruß
TINO
Millo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Mo 21.10.02 15:42 
Moin

erstmal hab ich ne andere Komponente benutz die NMFTP,weil ich kein Plan hatte wie das sonst mit Indy gehen soll.
Dann hab ich das so gelöst:


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  for i := 0 to Form1.NMFTP1.FTPDirectoryList.name.Count-1 do 
  begin
    Filename := Form1.NMFTP1.FTPDirectoryList.Name[i];
    if ExtractFileExt(Filename) = '' then
    with Form1.TreeView1.Items do
      begin
        itm := AddChild(site,Filename);
        itm.ImageIndex := 2;
        itm.SelectedIndex :=3;
      end; 
   end;


So die erste Zeile zählt alle Namen von Dateien und Ordnern. In der nächsten Zeile wird Filename der jeweilige name der Datei oder des Ordners zugewiesen. Wird in der nächsten zeile keine Dateinameserweiterung gefunden wir es in der TreeView geadded.