private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { try { mshtml.IHTMLDocument2 myDoc = (mshtml.IHTMLDocument2)webBrowser1.Document.DomDocument; (myDoc as HTMLDocumentClass).documentElement.setAttribute("scroll", "yes", 0); int ctrlHeight = webBrowser1.Height; int ctrlWidth = webBrowser1.Width; //document完整高度 int heightsize = (int)(myDoc as HTMLDocumentClass).documentElement.getAttribute("scrollHeight", 0); int widthsize = (int)(myDoc as HTMLDocumentClass).documentElement.getAttribute("scrollWidth", 0); ////Get Screen Height int screenHeight = (int)(myDoc as HTMLDocumentClass).documentElement.getAttribute("clientHeight", 0); int screenWidth = (int)(myDoc as HTMLDocumentClass).documentElement.getAttribute("clientWidth", 0); e.ToString(); } catch (Exception err) { MessageBox.Show(err.ToString()); } }
void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { LogUtility.LogUtility.LogFile(" doc completed " + e.ToString() + " " + e.Url.OriginalString, ModuleLogLevel); if (e.Url.OriginalString == textBox1.Text) { GoToAddress(); } }
private void wbBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { Console.WriteLine("e: " + e.ToString()); //Check if page is fully loaded or not if (this.wbBrowser1.ReadyState != WebBrowserReadyState.Complete) { return; } else { Console.WriteLine("didSetUrL: " + this.didSetUrl); if (this.didSetUrl) { this.didSetUrl = false; this.pageDidLoad = true; this.continueDownload(); } } }