tags:

views:

72

answers:

2

Hi, i won't to download multi files at this same time using c#, but i don't know how.

Please help.

+1  A: 

You should be able to use the WebClient class.

        WebClient client = new WebClient();
        client.DownloadFileAsync(new Uri("http://test.com/file1"), "C:/Localfile1");
        client.DownloadFileAsync(new Uri("http://test.com/file2"), "C:/Localfile2");
PhilB
Jap, but when I try download 3 files at this same time, files aren't downloading at this same time, but this download each file in turn
oski225
Check out http://msdn.microsoft.com/en-us/library/1tkaca2y.aspx for setting the maximum number of connections.
PhilB
Thank you very much, i try do that.
oski225
@PhilB, is it possible that you need to create multiple WebClients in your example? When I try something along this line, it tells me that WebClient cannot use parallel I/O... Or am I overlooking something?
Grif
A: 

If your trying to serve multiple download files on an asp.net post back, I've had alot of success zipping the files together on the fly, and streaming the result as the response.

edit -

This does not seems like what your trying to do, sorry.

asawyer