Dowloading a bunch of files asynchronous wait till last finished
- by Casper Broeren
I'm trying to download a lot of files after downloading a sql statement must insert a record.
I'm using System.Net.Client to download each file synchronously, still it could be done asynchronous. There's no relation or dependency between each download.
At first I just tried to use WebClient.DownloadFileAsync but that shutted the program down and killed all the download processes/threads. Second I tried to create a wait routine something like this;
while (processedFiles < totalFiles)
Thread.Sleep(1000)
This freezed everything. So could someone tell me which aproach to take to implement this Async?