06-14-2011, 02:22 PM
File Downloader With ProgressBar
Step 1: Setting Everything up
-Add a Webclient To your toolbox. Just right click to toolbox, click add items, and type in webclient on the filter to add it.
-Design your form... Mine is below...
-Design your form... Mine is below...
Spoiler (Click to View)
Step 2: Coding Button
Double Click the button and add this code...
Code:
webClient1.DownloadFileAsync(New Uri("http://www.downloadlink.com/filename.exe"), Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "/downloadedFile.exe")
You will need to edit the link ovbiously.
This Coding tells the webclient what to download and what the link is.
Step Three: Events
-Go to the Events of the WebClient. Go to DownloadProgressChanged and add this code...
Code:
progressBar1.Value = e.ProgressPercentage
-This updates the progressbar until it is complete.
You Are Done. If you want it to notify when the download is complete, you can add a messagebox or something under the downloadfilecomplete part of the events...
Sorry if its already posted, but i felt like making a tutorial.
Sorry if its already posted, but i felt like making a tutorial.