Is there an easy way to download a file using .NET 2.0??? I know I saw something a long time ago that had a very simple downloader, just two lines long - any one know how to do it???
Hi >> Saint
System.Net.WebClient I think is what you're looking for.
Yes, this is very easy to use to download. Here is C# code to download a file:
This is untested but converted code to C++ 2.0 should look like:Code:System.Net.WebClient Client = new System.Net.WebClient(); Client.DownloadFile("http://www.url.com/file.ext", string.Concat("C:\file\path", "filename"));
Code:System::Net::WebClient Client = new System::Net::WebClient(); Client->DownloadFile("http://url", string.Concat("c:\path", "filename"));
The code you posted Jordan works in VC++ .NET 2.0. I've actually used this before to download small ascii based files only - anyone ever used it for something large? Is there a way to get a progress of download?
Void
To get progess you would probably have to write your own library that uses sockets to connect and download.
There's a System.Net.Web.WebClient.DownloadProgressChanged event that you can use for large(ish) async downloads.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks