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

Prasant JinagaPosted Dec 29, 2010, 5:09 AM
Subhendu DePosted Dec 29, 2010, 4:13 AM
Workaround is to use some third party component like
http://www.codeproject.com/KB/IP/ftplib.aspx
Be aware before using it. Go through the codebase before putting it in production since it is third party open source component. Use that one and see if it works fine for you!!!
Prasant JinagaPosted Dec 29, 2010, 4:05 AM
Subhendu DePosted Dec 29, 2010, 3:27 AM
The FtpWebRequest class is in System.Net namespace. Check it from Object Explorer.
It should work....
Prasant JinagaPosted Dec 29, 2010, 2:07 AM
Subhendu DePosted Dec 29, 2010, 1:24 AM
thiago costaPosted Dec 29, 2010, 1:22 AM
I haven't tested it with ftp but might work..
using System.Net;
WebClient Client = new WebClient();
Client.DownloadFile("ftp://2.2.1.1/file.zip", "file.zip");
----EDIT---
Ohhhh, I just read this from our mate :
FtpWebRequest class instead of WebClient
I think he is right.
did you add
using System.Net;
webclient depends on it.
Prasant JinagaPosted Dec 28, 2010, 10:51 PM
Thanks,
Prasant
Subhendu DePosted Dec 28, 2010, 11:12 AM
For more details, look at the following link
http://www.devasp.net/net/articles/display/280.html