Prasant Jinaga

Prasant Jinaga

  • 933
  • 750
  • 420.1k

Download files from Ftp

Dec 28 2010 6:50 AM
Hi,

string remoteUri = ftp://myftp;
string fileName = "11187368121flynn1.doc", myStringWebResource = null;
WebClient myWebClient = new WebClient();
myWebClient.Credentials =
new NetworkCredential("*****","*****");
myStringWebResource = remoteUri + fileName;
// Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource);
myWebClient.DownloadFile(myStringWebResource, fileName);
// Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource);
Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" + Application.StartupPath);
I am trying to download files from ftp.The above code is working fine in VS 2005 and 2008,But its not working in VS 2003.and i wanted to do in VS 2003.Because there are some constraints in our project.We need to do in VS 2003.Can any one help on this plz...
 
Thanks,
Prasant

Answers (9)