> class Program > { > static void Main(string[] args) > { > // http://www.csidata.com/?page_id=2828 > // http://stackoverflow.com/questions/23703040/download-files-from-sftp-with-ssh-net-library > > //http://www.jokecamp.com/blog/connecting-to-sftp-with-key-file-and-password-using-ssh-net/ > string keyFile = @"c:/path-to-your-ppk-file/blah_private.ppk_openssh"; > string passPhrase = "your-passphrase"; > PrivateKeyFile privateKeyFile = new PrivateKeyFile(keyFile, passPhrase); > > string host = @"123.123.123.123"; > int port = 22; > string username = "root-user-name"; > string remoteFilename = @"/root/path-to-file/filename-to-download.ext"; > > //DateTime in Filename from here: http://www.dotnetperls.com/filename-datetime > > string localFilename = string.Format("Development-{0:yyyy-MM-dd_hh-mm-ss-tt}.ext", DateTime.Now); > localFilename = @"c:\users\Billy\download-path\" + localFilename; > > //using (var sftp = new SftpClient(host, port, username, password)) > > using (var sftp = new SftpClient(host, port, username, privateKeyFile)) > { > sftp.Connect(); > > using (var file = File.OpenWrite(localFilename)) > { > sftp.DownloadFile(remoteFilename, file); > } > > sftp.Disconnect(); > } > > } > } >Thank you, Matt