NET FTP Library
DirectoryParseFormats Property
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : DirectoryParseFormats Property

Contains regular expression formats to parse FTP directory listings. By default if a directory entry cannot be parsed it is not put into the list. To see lines that cannot be parsed, turn on StrictDirectoryParsing. You may add your own parsing formats to the list. Please use these regular expression groups. See the examples below.

Regular Expression Groups

Syntax
'Declaration
 
Public Property DirectoryParseFormats As System.Collections.Generic.List(Of String)
'Usage
 
Dim instance As FTP
Dim value As System.Collections.Generic.List(Of String)
 
instance.DirectoryParseFormats = value
 
value = instance.DirectoryParseFormats
public System.Collections.Generic.List<string> DirectoryParseFormats {get; set;}
public read-write property DirectoryParseFormats: System.Collections.Generic.List; 
public function get,set DirectoryParseFormats : System.Collections.Generic.List
public: __property System.Collections.Generic.List<string*>* get_DirectoryParseFormats();
public: __property void set_DirectoryParseFormats( 
   System.Collections.Generic.List<string*>* value
);
public:
property System.Collections.Generic.List<String^>^ DirectoryParseFormats {
   System.Collections.Generic.List<String^>^ get();
   void set (    System.Collections.Generic.List<String^>^ value);
}
Example
FTP ftp = new FTP(); //Trial Mode            
//FTP ftp = new FTP("place user name here", "place license key here");
 
// set the name of the FTP server( its URL )
ftp.HostAddress = "ftp.fsz.bme.hu"; // a hungarian university. change this to your ftp server
ftp.UserName = "anonymous"; // replace with your user name
ftp.Password = "user@mail.com"; // replace with your password
 
ftp.DirectoryParseFormats.Add(@"^(?<dir>[\-d])(?<permission>([\-rwxt]+))\s+\d+\s+\w+\s+\w+\s+(?<size>\d+)\s+(?<timestamp>\w+\s+\d+\s+\d{1,2}:\d{2})\s+(?<name>.+)");
Dim ftp As FTP = New FTP() 'Trial Mode
'FTP ftp = new FTP("place user name here", "place license key here");
 
' set the name of the FTP server( its URL )
ftp.HostAddress = "ftp.fsz.bme.hu" ' a hungarian university. change this to your ftp server
ftp.UserName = "anonymous" ' replace with your user name
ftp.Password = "user@mail.com" ' replace with your password
 
ftp.DirectoryParseFormats.Add("^(?<dir>[\-d])(?<permission>([\-rwxt]+))\s+\d+\s+\w+\s+\w+\s+(?<size>\d+)\s+(?<timestamp>\w+\s+\d+\s+\d{1,2}:\d{2})\s+(?<name>.+)")
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FTP Class
FTP Members