.net - Dowloading a bunch of files asynchronous wait till last finished -


I am trying to download a lot of files after downloading a SQL statement. I will upload each file from synchronously I'm using System.Net.Client to download, yet it can be asynchronous. There is no relation or reliance between each download.

First of all I tried to use WebClient.DownloadFileAsync, but he closed the program and killed all download processes / threads. Second, I tried to wait something like this;

  while (processed files & lt; totalFiles) threads Sleep (1000)  

All this was frozen, can anyone tell me what is the suitability to implement this ASC?

Ideally you can only download DownloadFileAsync Wrap the event to inform how you can wire the incident here:); Public static empty download file inbox math2 (string address) {web client client = new webclient (); Uri Uri = new Uri (address); // specify that DownloadFileCallback method when / Client.DownloadFileCompleted + = new asyncCompletedEventHandler (DownloadFileCallback2); // Specify a progress notice handler. Client Download Progress Changes + New Download Progressing Endthaler (DownloadProgramcolorBack); Client.DownloadFileAsync (Yuri, "serverdata.txt"); }

You can call it through the WinForms application, which will only remain inactive when the download is in progress. Then when all downloads are completed you can close the program or whatever you have to do.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -