code to download a file

May 1, 2012 at 5:41 PM
Edited May 1, 2012 at 5:44 PM

hi i'm trying to download a file from a ftp server

like http://sshnet.codeplex.com/wikipage?title=Draft%20for%20Documentation%20page

and i'm getting a no such file exception. 

could you help me?

Thanks

 

try{
string localFileName = System.IO.Path.GetFileName(downloadfile);
using (var fileforsftp = File.OpenWrite(localFileName))
{ sftp.DownloadFile(filetodownload, fileforsftp); }
} catch{}
May 2, 2012 at 2:24 PM

i also tried the renci ssh.net scp download but it gave an unable to find the file specified by filetodownload but i checked and the file is there..thanks