日期:2014-05-20  浏览次数:20633 次

webBrowser问题
webBrowser1.DocumentText   =   str;
webBrowser1.Navigating   +=   new   WebBrowserNavigatingEventHandler(webBrowser1_Navigating);
Thread.Sleep(2000);

while   (webBrowser1.ReadyState   !=   WebBrowserReadyState.Complete)//一直在这里循环webBrowser1.ReadyState=loading
{
        Thread.Sleep(2000);
}
strTmp   =   webBrowser1.Document.Body.InnerText.Trim();
………………
这个怎么解决?用webBrowser1.DocumentCompleted也不行

------解决方案--------------------
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();

------解决方案--------------------
while( webBrowser1.busy )
Application.DoEvents();