NET SFTP Library
Port Property (SFTP)
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class : Port Property
Specifies the port to communicate with the FTP Server. The default is 21.
Syntax
'Declaration
 
Public Property Port As System.Integer
'Usage
 
Dim instance As SFTP
Dim value As System.Integer
 
instance.Port = value
 
value = instance.Port
public System.int Port {get; set;}
public read-write property Port: System.Integer; 
public function get,set Port : System.int
public: __property System.int get_Port();
public: __property void set_Port( 
   System.int value
);
public:
property System.int Port {
   System.int get();
   void set (    System.int value);
}
Example
SFTP sftp = new SFTP(); //Trial Mode            
//SFTP sftp = new SFTP("place user name here", "place license key here");
 
// set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com"; // replace with your SFTP server
sftp.UserName  = "anonymous"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
 
// set the port on which the ftp server listens
sftp.Port = 21; // default is 21
 
System.Console.WriteLine("The servers port is {0}", sftp.Port);
Dim sftp As SFTP = New SFTP() 'Trial Mode
'Dim sftp As SFTP = New SFTP("place user name here", "place license key here");
 
' set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com" ' replace with your SFTP server
sftp.UserName  = "anonymous" ' replace with your user name
sftp.Password = "user@mail.com" ' replace with your password
 
' set the port on which the ftp server listens
sftp.Port = 21 ' default is 21
 
System.Console.WriteLine("The servers port is {0}", sftp.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

SFTP Class
SFTP Members