Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.7k views
in .NET FTP by (160 points)
hello,

can somebody please tell me how to get the complete directory rawlist of a directory as a string like this:
05-09-07  12:02PM       <DIR>          bussys
02-01-06  04:47PM       <DIR>          deskapps
02-01-06  04:52PM       <DIR>          developr

instead of e..g only the file / directoy names
bussys
deskapps
developr


i really need the rawlist, not all informations parsed and saved in an array.

thank you very much!

1 Answer

0 votes
by (51.6k points)
Hi,

Sorry for the slow reply. If you are using FTPClient (which is the older interface) you can use the function FTPClient.Dir(string,bool) with true as the second argument. FTPConnection doesn't allow you to do it so simply mainly because we hadn't anticipated that anyone would want to. There are basically two ways to do it using FTPConnection (and its subclasses):
  1. call GetFileInfos() and use FTPFile.Raw property to access the raw string that was parsed. Each directory entry has one so you should be able to get all of them
  2. create your own file parser by extending FTPFileParser and then select it using FTPConnection.FileInfoParser.FileParser = new MyFileParser(). The Parse method of this class will be called once for each line returned in the directory listing so you can build up a complete raw listing.


- Hans (EnterpriseDT)

Categories

...