Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When I use this code to download a file, the files are always at least 2 megabytes so the program "freezes" when you click on anything until the download is finished. Is there a way to make it work better? It's almost like it's not responding until the download is finished...Anyway to fix this?

 

Dim wcClient As System.Net.WebClient = New System.Net.WebClient

wcClient.DownloadFile("www.yoursite.com", "Filename.exe")

Posted (edited)
You may be better of using the HttpWebRequest class - either look at it's async Begin / End GetRequestStream methods' date=' or if you just want to display some indication of progress during a download look at clicky

 

I've tried that, the progressbar isn't even close to accurate...it finishes way before it should...Is it set to only work with small files?

 

Enclosed is the sample app that is in that link, the file I try to download is roughly 2 megabytes, the progressbar finishes in about 4 seconds and then the program hangs (unresponsive) for a while. Is there something that needs to be changed? Please check it out, the same url is still there from what I used.

web filesize with progressbar.zip

Edited by Sc0pe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...