当前位置: 首页>>代码示例>>C#>>正文


C# HTMLDocument类代码示例

本文整理汇总了C#中HTMLDocument的典型用法代码示例。如果您正苦于以下问题:C# HTMLDocument类的具体用法?C# HTMLDocument怎么用?C# HTMLDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HTMLDocument类属于命名空间,在下文中一共展示了HTMLDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadUrl

        public static void LoadUrl(ref HTMLDocument doc, String url, bool CreateSite)
        {
            if (doc == null)
            {
                throw new HtmlEditorException("Null document passed to LoadDocument");
            }

            if (CreateSite)
            {
                //set client site to DownloadOnlySite, to suppress scripts
                DownloadOnlySite ds = new DownloadOnlySite();
                IOleObject ob = (IOleObject)doc;
                ob.SetClientSite(ds);
            }

            IPersistMoniker persistMoniker = (IPersistMoniker)doc;

            IMoniker moniker = null;

            int iResult = win32.CreateURLMoniker(null, url, out moniker);

            IBindCtx bindContext = null;

            iResult = win32.CreateBindCtx(0, out bindContext);

            iResult = persistMoniker.Load(0, moniker, bindContext, constants.STGM_READ);

            persistMoniker = null;

            bindContext = null;

            moniker = null;

        }
开发者ID:jpespartero,项目名称:WorldWind,代码行数:34,代码来源:utils.cs

示例2: SlideTickScript

        public SlideTickScript(HTMLDocument Document)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("function slidetick(objname){");

                builder.Append("var elapsed = (new Date()).getTime() - startTime[objname];");
                builder.Append("if (elapsed > slideAniLen){");
                    builder.Append("endSlide(objname);");
                    builder.Append("}");

                builder.Append("else {");
                builder.Append("var d = Math.round(elapsed / slideAniLen * endHeight[objname]);");
                builder.Append("if(dir[objname] == 'up')");

            builder.Append("d = endHeight[objname] - d;");

                    builder.Append("obj[objname].style.height = d + 'px';");
                    builder.Append("}");

                builder.Append("return;");
            builder.Append("}");

            _script = (IHTMLScriptElement) Document.createElement("script");
            _script.type = "text/javascript";
            _script.text = builder.ToString();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:27,代码来源:SlideTickScript.cs

示例3: AllFramesProcessor

        public AllFramesProcessor(HTMLDocument htmlDocument)
        {
            Elements = new List<INativeDocument>();
            _htmlDocument = htmlDocument;

            _iFrameElements = (IHTMLElementCollection)htmlDocument.all.tags("iframe");
        }
开发者ID:koshdim,项目名称:KoWatIn,代码行数:7,代码来源:AllFramesProcessor.cs

示例4: VBScriptNode

        public VBScriptNode(HTMLDocument Document)
        {
            _script = (IHTMLScriptElement)Document.createElement("script");
            ((IHTMLElement) _script).setAttribute("language", "vbscript", 0);

            _script.text = "Function decline_link_click() : Document.getElementById(\"buy4_notice\").style.display=\"none\" : End Function";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:7,代码来源:VBScriptNode.cs

示例5: DocHTML

 public DocHTML(HTMLDocument doc)
 {
     mDoc = doc;
     mDoc2 = (IHTMLDocument2)mDoc;
     mDoc3 = (IHTMLDocument3)mDoc;
     mDoc4 = (IHTMLDocument4)mDoc;
     mDoc5 = (IHTMLDocument5)mDoc;
 }
开发者ID:jpespartero,项目名称:WorldWind,代码行数:8,代码来源:DocHTML.cs

示例6: GetFrameCountFromHTMLDocument

        internal static int GetFrameCountFromHTMLDocument(HTMLDocument htmlDocument)
        {
            var processor = new FrameCountProcessor(htmlDocument);

            IEUtils.EnumIWebBrowser2Interfaces(processor);

            return processor.FramesCount;
        }
开发者ID:fschwiet,项目名称:watin_unbranched,代码行数:8,代码来源:FrameCountProcessor.cs

示例7: LoadHtml

 /// <summary>
 /// Loading method
 /// HtmlDocument to create a HTML string
 /// </summary>
 /// <param name="html">HTML string</param>
 /// <returns></returns>
 public HtmlDocument LoadHtml(string html)
 {
     // Creating an object using a mshtml.HTMLDocument
     var doc = new HTMLDocument() as IHTMLDocument2;
     doc.write(new object[] { html });
     Load(doc);
     return this;
 }
开发者ID:moonmile,项目名称:XmlDom,代码行数:14,代码来源:HtmlDocument.cs

示例8: GetFrameFromHTMLDocument

        internal static IWebBrowser2 GetFrameFromHTMLDocument(int frameIndex, HTMLDocument htmlDocument)
        {
            var processor = new FrameByIndexProcessor(frameIndex, htmlDocument);

            IEUtils.EnumIWebBrowser2Interfaces(processor);

            return processor.IWebBrowser2();
        }
开发者ID:kevinswarner,项目名称:Hover_OLD,代码行数:8,代码来源:FrameByIndexProcessor.cs

示例9: OnDocumentComplete

        public void OnDocumentComplete(object pDisp, ref object URL)
        {
            document = (HTMLDocument)webBrowser.Document;

            foreach (IHTMLInputElement tempElement in document.getElementsByTagName("INPUT"))
            {
                System.Windows.Forms.MessageBox.Show(
                    tempElement.name != null ? tempElement.name : "it sucks, no name, try id" + ((IHTMLElement)tempElement).id);
            }
        }
开发者ID:Piick,项目名称:extensions,代码行数:10,代码来源:BHO.cs

示例10: DeclineHyperlink

        public DeclineHyperlink(HTMLDocument Document)
        {
            _anchor = Document.createElement("a");
            _anchor.setAttribute("href", "javascript:decline_link_click()", 0);

            _anchor.style.fontSize = "x-small";
            _anchor.style.fontWeight = "normal";

            _anchor.innerText = "No, thanks";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:10,代码来源:DeclineHyperlink.cs

示例11: AcceptHyperlink

        public AcceptHyperlink(HTMLDocument Document, string AcceptUrl, string StoreID)
        {
            _anchor = Document.createElement("a");
            _anchor.setAttribute("href", "javascript:accept_link_click();",0);
            _anchor.setAttribute("id", "accept_link", 0);

            _anchor.style.fontSize = "x-small";
            _anchor.style.fontWeight = "bold";

            _anchor.innerText = "Yes, Log Me In";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:11,代码来源:AcceptHyperlink.cs

示例12: YesLink

        public YesLink(HTMLDocument Document, string AcceptUrl, string StoreID, string ReturnUrl)
        {
            _yes_link = Document.createElement("a");

            AcceptUrl = AcceptUrl
                .Replace("###id###", StoreID)
                .Replace("###return_url###", ReturnUrl);

            _yes_link.setAttribute("href",AcceptUrl,0);
            _yes_link.setAttribute("id", "yes_link",0);
            _yes_link.innerText = "Yes";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:12,代码来源:YesLink.cs

示例13: Login

        /// <summary>
        /// Log-into the web application.
        /// </summary>
        /// <param name="navigationUrl">The navigation URL.</param>
        /// <param name="userNameTextBoxID">The user name text box ID.</param>
        /// <param name="passwordTextBoxID">The password text box ID.</param>
        public static void Login(string navigationUrl, string userNameTextBoxID, string passwordTextBoxID)
        {
            InternetExplorer browser = new InternetExplorer();
            object mVal = System.Reflection.Missing.Value;
            browser.Navigate(navigationUrl, ref mVal, ref mVal, ref mVal, ref mVal);

            HTMLDocument pageDocument = new HTMLDocument();
            System.Threading.Thread.Sleep(2000);
            pageDocument = (HTMLDocument)browser.Document;
            LoginInternal(userNameTextBoxID, passwordTextBoxID, pageDocument);
            browser.Visible = true;

        }
开发者ID:mavrk,项目名称:nagarro-SingleSignOn,代码行数:19,代码来源:WebsiteLogin.cs

示例14: create_display_div

        public static IHTMLDOMNode create_display_div(HTMLDocument document,Store store,config config)
        {
            IHTMLElement div = document.createElement("div");

            /* This will be removed */
            YesLink yes = new YesLink(document, config.accept_url, store.id, document.url);

            ((IHTMLDOMNode) div).appendChild((IHTMLDOMNode) yes.Element);

            /* End removed */

            return (IHTMLDOMNode) div;
        }
开发者ID:grefly,项目名称:Buy4,代码行数:13,代码来源:DisplayDivFactory.cs

示例15: AcceptLinkClickScript

        public AcceptLinkClickScript(HTMLDocument Document)
        {
            StringBuilder builder = new StringBuilder();

            // This function is called when the user clicks the YES, LOG ME IN link
            builder.Append("function accept_click(){");
            builder.Append("set_cookie_cache();");
            builder.Append("}");

            _script = (IHTMLScriptElement) Document.createElement("script");
            _script.type = "text/javascript";
            _script.text = builder.ToString();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:13,代码来源:AcceptLinkClickScript.cs


注:本文中的HTMLDocument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。