在指定webBrowser的URL后如何立即生效?
代码:
this.webBrowser.Url=new Uri( "c:\autoexec.bat ");
strDoc = this.webBrowser1.DocumentText;
此时strDoc仍为空,应该如何做?
------解决方案--------------------//参考如下代码:
webBrowser1.Url = new Uri( "C:\\Temp\\Temp.htm ");
while (webBrowser1.ReadyState == WebBrowserReadyState.Loading)
Application.DoEvents();
string strDoc = webBrowser1.DocumentText;