'Webclient DownloadFileAsync is way slower than downloading same file from Browser
So I wrote a program which downloads mp3 files from a website. They are about 17mb and if I download them using my browser, each file takes 2 seconds. However using webClient.DownloadFileAsync each file takes roughly 2 minutes. I don't know how I can fix this; I tried changing the webClient Proxy setting, but without any success.
This is my code
List<string> links = new List<string> { };
WebClient client = new WebClient();
client.Proxy = GlobalProxySelection.GetEmptyWebProxy();
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
client.DownloadFileAsync(new Uri(links[counter - 1]), @"downloads\" + removeInvalid + @"\" + removeInvalid + " " + counter + ".mp3");
client.Dispose();
Any help would be greatly appreaciated :)
Solution 1:[1]
I know that its too late, but for me helped set proxy to:
webClient.Proxy = WebRequest.DefaultWebProxy;
Setting proxy to null also didnt helped for me
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | UdoQQ |
