Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net;
- using System.Windows.Forms;
- namespace TestWinForms
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private delegate void FormDelegate();
- private void button1_Click(object sender, EventArgs e)
- {
- UseWaitCursor = true;
- button1.Enabled = false;
- BeginInvoke(new FormDelegate(delegate
- {
- using (WebClient web = new WebClient())
- {
- web.Encoding = System.Text.Encoding.UTF8;
- textBox1.Text = web.DownloadString("https://stackoverflow.com/");
- }
- UseWaitCursor = false;
- button1.Enabled = true;
- }));
- }
- }
- }
Add Comment
Please, Sign In to add comment