Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

C#
String remoteUri = "ftp://myftp/";
String fileName = "11187368121flynn1.doc", myStringWebResource = null;
WebClient myWebClient = new WebClient();
myWebClient.Credentials = new NetworkCredential("*****","*****");
myStringWebResource = remoteUri + fileName;
myWebClient.DownloadFile(myStringWebResource, fileName);
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 it's not working in VS 2003.

I want to do this in VS 2003 because there are some constraints in our project. Can any one help on this please?

Thanks,
Prasant
Posted
Updated 28-Dec-10 3:40am
v5
Comments
Slacker007 28-Dec-10 7:00am    
@Hiren: I was unable to get the Code Block tags to work right for this particular question edit. If you were successful than thank you.

1 solution

Hi Prasant,

I have some unpleasant news for you. .NET 1.1 WebClient has no build in support for FTP and FTPWebRequest was only introduced in .NET 2.0. Your code should throw a "not supported" exception.
You will have to search the net to see if you can find an FTP implementation for .NET 1.1 .

I'm sorry. :((

Modification:
Just found this here on CP maybe it'll do, please check it out:
http://www.codeproject.com/KB/IP/ftpclientclass.aspx[^]

Good luck!

Manfred
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900