日期:2014-05-17 浏览次数:20983 次
//
//
private void extendedWebBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(aa));
}
private void aa(object obj)
{
string sourceStr=extendedWebBrowser1.Document.Body.InnerHtml.ToString();//指定的转换无效
}
//
//
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(this.GetDocHtml));
}
private void GetDocHtml(object o)
{
Func<string> f = new Func<string>(GetHtml);
object html = this.Invoke(f);
MessageBox.Show(html.ToString());
}
private string GetHtml()
{
return webBrowser1.Document.Body.InnerHtml;
}