Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string host = "";
- string username = "";
- string password = "";
- string localFileName = System.IO.Path.GetFileName(localFile);
- string remoteFileName = "";
- using (var sftp = new SftpClient(host, username, password))
- {
- sftp.Connect();
- using (var file = File.OpenWrite(localFileName))
- {
- sftp.DownloadFile(remoteFileName, file);
- }
- sftp.Disconnect();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement