PowerTCP SSH and SFTP for .NET

from $349.00
Available Platforms

SFTP Get Code Example

See all PowerTCP SSH and SFTP for .NET Code Examples

 

The following example demonstrates an SFTP session, in which a file is downloaded from the server.

 

Sftp sftp1 = new Sftp();
sftp1.Connection.RemoteEndPoint.HostNameOrAddress = "mySFtpServer.com";
sftp1.Connect();
SshLoginData loginDetails = new SshLoginData();
loginDetails.Username = "myUsername";
loginDetails.Password = "myPassword";
sftp1.Authenticate(loginDetails);
sftp1.Get("myFile.txt", "c:\\MyFiles\\myFile.txt", CopyMode.Copy);
sftp1.Close();

 

To download a trial please visit the PowerTCP SSH and SFTP for .NET product page.