Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. string url = @"http://dl2.soft98.ir/soft/NET.Framework.4.5.50709.x86-x64.rar";
  4.  
  5. // Create an instance of WebClient
  6. WebClient client = new WebClient();
  7.  
  8. // Hookup DownloadFileCompleted Event
  9. client.DownloadFileCompleted +=
  10. new AsyncCompletedEventHandler(client_DownloadFileCompleted);
  11.  
  12. // Start the download and copy the file to c:temp
  13. client.DownloadFileAsync(new Uri(url), @"c:frame.zip");
  14. }
  15.  
  16. void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
  17. {
  18. MessageBox.Show("File downloaded");
  19. }
  20.  
  21. private void button1_Click(object sender, EventArgs e)
  22. {
  23. string url = @"http://www.persiajonoub.net/soft/NET.Framework.4.5.50709.x86-x64.rar";
  24.  
  25. // Create an instance of WebClient
  26. WebClient client = new WebClient();
  27.  
  28. // Hookup DownloadFileCompleted Event
  29. client.DownloadFileCompleted +=
  30. new AsyncCompletedEventHandler(client_DownloadFileCompleted);
  31.  
  32. // Start the download and copy the file to c:temp
  33. client.DownloadFileAsync(new Uri(url), @"c:frame.zip");
  34. }
  35.  
  36. void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
  37. {
  38. MessageBox.Show("File downloaded");
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement