Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. private void Rectangle_MouseLeftButtonDown_6(object sender, MouseButtonEventArgs e)
  2. {
  3.  
  4.  
  5.  
  6. WebClient webClient = new WebClient();
  7. webClient.DownloadStringCompleted += Completed;
  8. webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
  9. webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
  10. webClient.DownloadFileAsync(new Uri("http://prodigygaming.comxa.com/updates/redacted.zip"), @"./redacted.zip");
  11.  
  12.  
  13. filcheck.Text = "Download in procces";
  14.  
  15.  
  16. }
  17.  
  18.  
  19. private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
  20. {
  21.  
  22. pbStatus.Value = e.ProgressPercentage;
  23.  
  24. }
  25.  
  26. private void Completed(object sender, AsyncCompletedEventArgs e)
  27. {
  28.  
  29. MessageBox.Show("Download completed!");
  30. pbStatus.Visibility = Visibility.Hidden;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement