0

I have been making a downloader in vb.net everything is working fine Appart from the downloading, it takes around 10 seconds for the download to start Is this normal or am I doing something wrong? The download is being done in a thread and before when I have tried to download outside of a thread the program dosnt respond for those 10 seconds Any help is much appreciated :) Reblerebel

Code:

download = New WebClient
download.DownloadFileAsync(New Uri(File to DDR ), download)
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
reblerebel
  • 43
  • 2
  • 8
  • 1
    In order for us to provide any useful feedback, we're going to need some code from you so that we can see what you are doing. Although talented programmers, we are not, sadly, mindreaders. – competent_tech Dec 10 '11 at 03:33
  • Sorry man I had just finished programming and have gone to bed so was posting on the iPhone – reblerebel Dec 10 '11 at 03:35
  • Dear reblerebel, its obviously abnormal that the download begins after about 10 seconds, and of course something is wrong with it, but we can't help if you don't provide us the code. – Ashkan Mobayen Khiabani Dec 10 '11 at 03:45
  • Read SO thread - (Is WebClient.DownloadFileAsync really this slow?) thread http://stackoverflow.com/questions/754333/why-is-this-webrequest-code-slow/935728#935728 – KV Prajapati Dec 10 '11 at 06:08

1 Answers1

1

what i used to fix it, thanks to AVD! set the web client proxy to nothing in the code

the code i had:

download = New WebClient download.DownloadFileAsync(New Uri(File to DDR ), download)

What i added to fix it

download.proxy = Nothing

Update: to accommodate users that may use a proxy this code will get the system proxy

download.Proxy = System.Net.HttpWebRequest.DefaultWebProxy.Credentials

hope this helps!

reblerebel
  • 43
  • 2
  • 8
  • This sounds unwise. What will happen when the machine actually uses a proxy? You'd be much better off properly configuring the proxy setting in Control Panel + Internet Options. Ask questions about it at superuser.com – Hans Passant Dec 10 '11 at 16:48