How to use sftp in C#

kevin picture kevin · Nov 11, 2011 · Viewed 87.9k times · Source

Possible Duplicate:
How do I upload a file to an SFTP server in C# / .NET?

Does .net support sftp?

I can't find any sample online.

Answer

Piers Myers picture Piers Myers · Nov 11, 2011

We have used SharpSSH for sftp, it works well and is open source.

Code example:

sftp = new Tamir.SharpSsh.Sftp(ipAddress, username, password);
sftp.Connect();
sftp.Get(sourcePath, destinationPath);
sftp.Close();