using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //自定义线程 System.Threading.Thread x; delegate void CallBackPro(string url); private void Form1_Load(object sender, EventArgs e) { } public void ThreadPro() { SafeThreadProc("www.baidu.com"); } private void SafeThreadProc(string url) { if (this.webBrowser1.InvokeRequired) { CallBackPro stdv = new CallBackPro(SafeThreadProc); this.Invoke(stdv, new object[] { url }); } else { this.webBrowser1.Navigate(url); MessageBox.Show(webBrowser1.ReadyState.ToString()); } } private void button1_Click(object sender, EventArgs e) { x = new System.Threading.Thread(new System.Threading.ThreadStart(this.ThreadPro)); x.Start(); } } }
按第一次是uninitialed 等网页加载再按就是Loadeing
还不会吗。。。我看到你两次了
不好意思,我是新手,理解起来不是很快。谢谢您!