webBrowser.Navigated += new WebBrowserNavigatedEventHandler(webBrowser_Navigated); loading = true; //表示正在加载 webBrowser.Navigate(url); while (loading) { Application.DoEvents();//等待本次加载完毕才执行下次循环. } return html;
通过Navigated事件
webBrowser.Navigated += new WebBrowserNavigatedEventHandler(webBrowser_Navigated); loading = true; //表示正在加载 webBrowser.Navigate(url); while (loading) { Application.DoEvents();//等待本次加载完毕才执行下次循环. } return html;
通过Navigated事件