Created
December 11, 2013 17:08
-
-
Save JoshVarty/7914461 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Window1 : Window | |
{ | |
public Window1() | |
{ | |
InitializeComponent(); | |
string HCDownloadURL = String.Format("http://www.survivaloperations.net/client/hardcorps/HardCorps.zip"); | |
WebClient Download_Client = new WebClient();//Declaring the webclient as Download_Client | |
Download_Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);//the event handler | |
Download_Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);// " " | |
Download_Client.DownloadFileAsync(new Uri(HCDownloadURL.Trim().ToString()), "test.zip");// " " | |
} | |
private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) | |
{ | |
pbDownloader.Value = e.ProgressPercentage;//setting the progressbar value as downloadprogress | |
} | |
private void Completed(object sender, AsyncCompletedEventArgs e) | |
{ | |
pbDownloader.Value = (0);//resetting the progressbar | |
//file is saved in /bin/x86/debug | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment