public IEOperateCore(string url) { IE = InternetExplorerFactory.GetInternetExplorer(url); HWND = new IntPtr(IE.HWND); int loopCount = 0; while (IE.ReadyState != tagREADYSTATE.READYSTATE_COMPLETE) { try { dom = (HTMLDocumentClass)IE.Document; } catch (Exception) { Thread.Sleep(1000); continue; } if (dom.readyState.Equals("complete")) { break; } if (loopCount > 2000) { throw new Exception("open " + url + " timeout!"); } Thread.Sleep(500); loopCount++; } }
public IEOperateCore() { IE = InternetExplorerFactory.GetInternetExplorer(); HWND = new IntPtr(IE.HWND); }