Exemplo n.º 1
0
 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 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());
            }
        }