NET FTP Library
Port Property (FTP)
Example 






KellermanSoftware.NetFtpLibrary Namespace > FTP Class : Port Property
Specifies the port to communicate with the FTP Server. The default is 21.
Syntax
'Declaration
 
Public Overridable Property Port As System.Integer
'Usage
 
Dim instance As FTP
Dim value As System.Integer
 
instance.Port = value
 
value = instance.Port
public virtual System.int Port {get; set;}
public read-write property Port: System.Integer; virtual; 
public function get,set Port : System.int
public: __property virtual System.int get_Port();
public: __property virtual void set_Port( 
   System.int value
);
public:
virtual property System.int Port {
   System.int get();
   void set (    System.int 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
 
// set the port on which the ftp server listens
ftp.Port = 21; // default is 21
 
System.Console.WriteLine("The servers port is {0}", ftp.Port);
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
 
' set the port on which the ftp server listens
ftp.Port = 21 ' default is 21
 
System.Console.WriteLine("The servers port is {0}", ftp.Port)
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