This project is read-only.

code to download a file

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

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


and i'm getting a no such file exception. 

could you help me?



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

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