Guest User

Untitled

a guest
Mar 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Windows.Forms;
  4.  
  5. namespace TestWinForms
  6. {
  7. public partial class Form1 : Form
  8. {
  9. public Form1()
  10. {
  11. InitializeComponent();
  12. }
  13.  
  14. private delegate void FormDelegate();
  15. private void button1_Click(object sender, EventArgs e)
  16. {
  17. UseWaitCursor = true;
  18. button1.Enabled = false;
  19.  
  20. BeginInvoke(new FormDelegate(delegate
  21. {
  22. using (WebClient web = new WebClient())
  23. {
  24. web.Encoding = System.Text.Encoding.UTF8;
  25. textBox1.Text = web.DownloadString("https://stackoverflow.com/");
  26. }
  27.  
  28. UseWaitCursor = false;
  29. button1.Enabled = true;
  30. }));
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment