Autor Beitrag
cromos
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: So 18.04.04 19:40 
Hallo zusammen,

ich suche schon seit stunden nach einem Tut für Indy und FTP aber bis jetzt habe ich nichts gefunden.
Also ich möchte ein kleines FTP-Programm schreiben.

Verbinden und ausloggen klappt schon.
Aber wie kann ich wenn ich eingeloggt bin die Dateien und Verzeichnisse die sich auf dem Server befinden ausgeben.
Und welches Steuerelemnt nutze ich am besten dafür???

Gruss
Cromos


Zuletzt bearbeitet von cromos am Mo 19.04.04 22:21, insgesamt 1-mal bearbeitet
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: So 18.04.04 19:50 
OK, ich habe grade 4 Threads weiter einen guten Lösungsansatz gefunden:

ausblenden Delphi-Quelltext
1:
IDFTP1.List(ListBox1.Items,'',false);					


Damit bekomme ich die Dateien und Ordner in eine ListBox.
Aber ich möchte das gerne in einer ShellListView ausgegeben haben.
Ist das möglich? Und wenn ja wie??

Danke und Gruss
Cromos
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: So 18.04.04 21:25 
Hallo nochmal,

also bezüglich idFTP ist ja so gut wie garnix im Internet zu finden.

Ich habe mir überlegt das ich die Ordner und die Dateien in 2 seperaten Listboxen ausgeben will.
Wie mache ich das.

Ich habe das hier gefunden:
ausblenden Delphi-Quelltext
1:
DirectoryListing					


Die "tolle" OH kann man in diesem speziellen Fall in die Tonne kloppen :lol:
Kann mir jemand ein Beispiel geben oder mir sagen wie das Funktioniert?

Gruss
Cromos
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: So 18.04.04 22:28 
Ahhrg ich geh kaputt :D
Heute klappt aber auch gar nichts :D

Ich möchte alle Ordner in eine Seperate ListBox packen.
Habe mir folgendes ausgedacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
AFiles := TStringList.Create;
    idFTP1.List(AFiles, '', True);
    for i := 0 to idFTP1.DirectoryListing.Count - 1 do
      begin
        if IdFtp1.DirectoryListing.Items[i].ItemType = ditDirectory then
          ListBoxO.additem(idFTP1.DirectoryListing.Items[i]);
      end;


Klappt aber nicht. Er sagt mir

[Fehler] Unit1.pas(141): Inkompatible Typen: 'String' und 'TIdFTPListItem'

Kann mir da jemand weiterhelfen???

Gruss
Cromos
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Mo 19.04.04 06:36 
wenn ich mich nicht irre ist der 1. parameter von additem ein String!

Martin
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Mo 19.04.04 08:54 
Ja klar ist das ein String.

Also wie ich schreibe ich das:

ausblenden Delphi-Quelltext
1:
ListBoxO.additem(idFTP1.DirectoryListing.Items[i]);					


so das, das passt???

Hab schon stundenlang nach Dokus und in Foren gesucht. Nix zu finden.

Gruss
Cromos
lkz633
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 136

WinXP, Suse Linux 8.2 (unter VMWare)
D7 Prof, K3 Prof
BeitragVerfasst: Mo 19.04.04 09:59 
Hallo,

du willst ja nur Text ohne ein Object anhaengen, also:
ausblenden Delphi-Quelltext
1:
listbox.items.add(IdFTP1.DirectoryListing.Items[i].Text);					


Gruss lkz633
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Mo 19.04.04 12:56 
Danke, das hat geklappt.
Das einzige ist das das jetzt mit allen ATributen(Datum ,rechte) usw ausgegeben wird.

Wenn jemand dafür noch einen Tip hatte wäre super. Ich möchte nur die Namen der Ordner ohne Zusatzinfos haben.

Gruss
Cromos
lkz633
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 136

WinXP, Suse Linux 8.2 (unter VMWare)
D7 Prof, K3 Prof
BeitragVerfasst: Mo 19.04.04 13:10 
Hallo,

ersetzte text durch filename.

Das haettest du aber auch selber herausfinden koennen, indem du entweder:

1) Hilfe zu ftplistitem liest

2) Oder ,nachdem du items[i]. eingegeben hast,warten, was Delphi dir als Option anbietet

Gruss lkz633