Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   idFTP in Datenmodul? (https://www.delphipraxis.net/162065-idftp-datenmodul.html)

ernschd 4. Aug 2011 11:42

idFTP in Datenmodul?
 
Hallo,

ich habe meine TidFTP-Komponente vom Formular in ein Datenmodul ausgelagert (Indy Version 10.1.1).
Seitdem liefert mir aber u.a. FTP.DirectoryListing immer nur nil. Woher kommt das? Die gesendeten FTP-Kommandos kommen aber auf dem Server an.

Das Datenmodul wird auch vor dem Formular erzeugt.

Delphi-Quellcode:
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.Title := '';
Application.CreateForm(TDataModule1, DataModule1);
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
Kann es evtl. daran liegen, dass das Ftp.List-Kommando und FTP.DirectoryListing in einer separaten Unit aufgerufen werden?

Delphi-Quellcode:
ls := TStringList.Create;
DataModule1.ftp.ChangeDir(dir);
DataModule1.ftp.List(ls);
for i:=0 to DataModule1.ftp.DirectoryListing.Count-1 do
 datei := DataModule1.ftp.DirectoryListing.Items[i].Filename;
Die Stringliste (ls) wird auch brav gefüllt. Ich bin mittlerweile ratlos.

CCRDude 4. Aug 2011 12:08

AW: idFTP in Datenmodul?
 
Ich hatte auch schon einmal Probleme mit Indy 10-FTP-Listings (auch separat erzeugt, nicht zur Design time auf einer Form). Abhilfe geschaffen hat es, die passende Unit für die Listings des angesprochenen Servers manuell einzubinden. Schau mal nach IdFTPListParse*.pas.


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz