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


C# HtmlElement.InvokeMember方法代码示例

本文整理汇总了C#中System.Windows.Forms.HtmlElement.InvokeMember方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlElement.InvokeMember方法的具体用法?C# HtmlElement.InvokeMember怎么用?C# HtmlElement.InvokeMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.HtmlElement的用法示例。


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

示例1: Click

 public void Click(HtmlElement h)
 {
     Focus(h);
     Over(h);
     Down(h);
     h.InvokeMember("click");
 }
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:7,代码来源:ClickTask.cs

示例2: WebBrowserInvokeMember

 private void WebBrowserInvokeMember(HtmlElement h, string action)
 {
     h.InvokeMember(action);
     DateTime dt = DateTime.Now;
     WebBrowserReadyState readyState = GetWebBrowserReadyState();
     while (readyState != WebBrowserReadyState.Complete /*&& webBrowser1.ReadyState != WebBrowserReadyState.Loaded*/ &&
     (DateTime.Now - dt).TotalSeconds < 10)
     {
         Application.DoEvents();
         Thread.Sleep(100);
     }
     Application.DoEvents();
     Thread.Sleep(1000);
 }
开发者ID:molec1,项目名称:MySPM_NewParsers,代码行数:14,代码来源:Form1.cs

示例3: vl1f

 //Insert values
 public void vl1f()
 {
     hElement1 = webBrowser1.Document.GetElementById(textBoxJSLogin.Text);
     hElement1.SetAttribute("value", textBoxBrowserLogin.Text);
     hElement2 = webBrowser1.Document.GetElementById(textBoxJSPass.Text);
     hElement2.SetAttribute("value", textBoxBrowserPassword.Text);
     hElement3 = webBrowser1.Document.GetElementById(textBoxJSForm.Text);
     hElement3.InvokeMember(textBoxJSSubmit.Text);
 }
开发者ID:salih18200,项目名称:orcs,代码行数:10,代码来源:Calendar.cs

示例4: PopulateInputFile

        async Task PopulateInputFile(HtmlElement file, String photo)
        {
            file.Focus();

            // delay the execution of SendKey to let the Choose File dialog show up
            var sendKeyTask = TaskEx.Delay(500).ContinueWith((_) =>
            {
                // this gets executed when the dialog is visible
                SendKeys.SendWait(photo + "{ENTER}");
            }, TaskScheduler.FromCurrentSynchronizationContext());

            file.InvokeMember("Click"); // this shows up the dialog

            await sendKeyTask;
            file.RemoveFocus();

            // delay continuation to let the Choose File dialog hide
            await TaskEx.Delay(500);
        }
开发者ID:takaaptech,项目名称:KSTN-Facebook-Tool-IE,代码行数:19,代码来源:WebBrowserForm.cs

示例5: click

 public void click(HtmlElement elm)
 {
     if (elm == null)
         return;
     elm.InvokeMember("click");
 }
开发者ID:waitingzeng,项目名称:ttwait-code,代码行数:6,代码来源:SimpleDocument.cs

示例6: Up

 public void Up(HtmlElement h)
 {
     h.InvokeMember("fireEvent", new object[] { "onkeyup" });
 }
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:4,代码来源:KeyboardTask.cs

示例7: Down

 public void Down(HtmlElement h)
 {
     h.InvokeMember("fireEvent", new object[] { "onkeydown" });
 }
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:4,代码来源:KeyboardTask.cs

示例8: timer1_Tick

        private void timer1_Tick(object sender, EventArgs e)
        {
            switch (step)
            {
                case 1:

                    step = 0;
                    toolStep.Text = "Étape : 1";
                    hotmailer.webBrowser1.Navigate("http://google.com");
                    hotmailer.Show();
                    step = 2;

                    break;

                case 2:

                    step = 0;
                    toolStep.Text = "Étape : 2";

                    identity = hotmailer.webBrowser1.Document.GetElementById("identity");

                    /*
                     * Modifications for GAF
                     *
                     */

                    SendKeys.Send("test");
                    ClearCookies();
                    WebBrowserHelper.ClearCache();
                    break;

                    if (identity != null)
                    {
                        // Entre mot de passe
                        identity.Focus();

                        SendKeys.Send("loubna");

                        if (identity.GetAttribute("value") != "loubna")
                        {
                            // La page n'était pas chargée
                            step = 2;
                            return;
                        }

                        // Entre code de campagne.
                        campaignCode = hotmailer.webBrowser1.Document.GetElementById("campaignCode");
                        campaignCode.Focus();

                        SendKeys.SendWait(codeDeCampagne);

                        while (campaignCode.GetAttribute("value") != codeDeCampagne)
                        {
                            campaignCode.Focus();

                            // Problème quelconque: on efface l'input et recommence.
                            while (campaignCode.GetAttribute("value") != "")
                            {
                                SendKeys.SendWait("{BACKSPACE}");
                            }

                            SendKeys.SendWait(codeDeCampagne);
                        }

                        // Clique sur une DIV invisble ayant onclick="next();": simule un "{ENTER}"
                        pressEnter = hotmailer.webBrowser1.Document.GetElementById("pressEnter");
                        pressEnter.InvokeMember("click");

                        step = 3;
                    }
                    else
                    {
                        step = 2;
                    }

                    break;

                case 3:

                    step = 0;
                    toolStep.Text = "Étape : 3";

                    // Collecte le compte Yahoo
                    address = hotmailer.webBrowser1.Document.GetElementById("address");
                    strAddress = address.GetAttribute("value");

                    if (strAddress == "")
                    {
                        // La page n'était pas chargée
                        step = 3;
                        return;
                    }

                    // Collecte le mot de passe
                    password = hotmailer.webBrowser1.Document.GetElementById("password");
                    strPassword = password.GetAttribute("value");

                    // Collecte le récipient
                    recipient = hotmailer.webBrowser1.Document.GetElementById("recipient");
                    strRecipient = recipient.GetAttribute("value");
//.........这里部分代码省略.........
开发者ID:blorenz,项目名称:seocortex,代码行数:101,代码来源:Macro.cs

示例9: Click

 public void Click(HtmlElement elem)
 {
     elem.InvokeMember("click");
 }
开发者ID:Alister742,项目名称:ParseKit,代码行数:4,代码来源:BrowserBot.cs

示例10: ClickNextPage

        public bool ClickNextPage(IntPtr hwnd, HtmlElement visitItem)
        {
            Point p = GetOffset(visitItem);
            Size winSize = InitialTabBrowser.Document.Window.Size;
            InitialTabBrowser.Document.Window.ScrollTo(winSize.Width / 2, p.Y);
            p.Y -= InitialTabBrowser.Document.GetElementsByTagName("HTML")[0].ScrollTop;
            p.X += visitItem.OffsetRectangle.Width / 2;
            p.Y += visitItem.OffsetRectangle.Height / 2;

            InitialTabBrowser.Document.InvokeScript("simulate", new object[] { visitItem.Parent.DomElement, "click" });
            //HtmlElement ele = InitialTabBrowser.Document.GetElementFromPoint(p);
            ClickOnPointInClient(hwnd, p);

            //ClientToScreen(hwnd, ref p);
            //Cursor.Position = new Point(p.X, p.Y);
            visitItem.InvokeMember("click");
            //ClickOnPoint(hwnd, p);

            return true;
        }
开发者ID:CocacolaSh,项目名称:AutoBroswer,代码行数:20,代码来源:SimulateTab.cs

示例11: NavigateToSite

 protected void NavigateToSite(HtmlElement oLink, ref WebBrowser oBrowser)
 {
     CountedWait oCWTimer = new CountedWait(ref oBrowser, 3000);
     while (true)
     {
         try
         {
             sSiteToNavigate = oLink.GetAttribute("href");
             oLink.InvokeMember("click");
             if (oCWTimer.Wait(10))
             {
                 bSiteFound = true;
                 TimedWait oTimedWait = new TimedWait(oRandomizer.Next(10000, 30000));
                 oTimedWait.Wait();
                 return;
             }
             else
             {
                 //System.Console.WriteLine("Proxy timeout, switching to next one.");
                 wininet.RefreshIEProxySettings();
             }
         }
         catch (UnauthorizedAccessException ex)
         {
             throw new UnauthorizedAccessException("..::" + this.GetType().Name + "::..NavigateToSite thrown an exception", ex);
         }
         catch (AccessViolationException ex)
         {
             throw new AccessViolationException("..::" + this.GetType().Name + "::..NavigateToSite thrown an exception", ex);
         }
         catch (Exception ex)
         {
             System.Console.WriteLine("..::" + this.GetType().Name + "::..NavigateToSite thrown an exception, reason:  " + ex.Message + ", switching proxy");
             wininet.RefreshIEProxySettings();
         }
     }
 }
开发者ID:kreuzerkrieg,项目名称:DotNetJunk,代码行数:37,代码来源:Program.cs

示例12: GoToNextPage

        protected void GoToNextPage(HtmlElement oLink, ref WebBrowser oBrowser)
        {
            CountedWait oCWTimer = new CountedWait(ref oBrowser, 3000);
            while (true)
            {
                try
                {
                    // Below line added to rise UnauthorizedAccessException in case something went wrong
                    String sHREF = oLink.GetAttribute("href");

                    oLink.InvokeMember("click");
                    if (oCWTimer.Wait(10))
                    {
                        TimedWait oTimedWait = new TimedWait(oRandomizer.Next(8000, 14000));
                        oTimedWait.Wait();
                        return;
                    }
                    else
                    {
                        //System.Console.WriteLine("Proxy timeout, switching to next one.");
                        wininet.RefreshIEProxySettings();
                    }
                }
                catch (UnauthorizedAccessException ex)
                {
                    throw new UnauthorizedAccessException("Unauthorized access to HTML properties, aborting operation", ex);
                }
                catch (AccessViolationException ex)
                {
                    throw new AccessViolationException("Access Violation, aborting operation", ex);
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("..::" + this.GetType().Name + "::..GoToNextPage thrown an exception, reason:  " + ex.Message + ", switching proxy");
                    wininet.RefreshIEProxySettings();
                }
            }
        }
开发者ID:kreuzerkrieg,项目名称:DotNetJunk,代码行数:38,代码来源:Program.cs

示例13: Over

 public void Over(HtmlElement h)
 {
     h.InvokeMember("fireEvent", new object[] { "onmouseover" });
 }
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:4,代码来源:ClickTask.cs

示例14: MouseClick

 public void MouseClick(HtmlElement h)
 {
     h.InvokeMember("fireEvent", new object[] { "onmouseclick" });
 }
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:4,代码来源:ClickTask.cs

示例15: Move

 public void Move(HtmlElement h)
 {
     h.InvokeMember("fireEvent", new object[] { "onmousemove" });
 }
开发者ID:pisceanfoot,项目名称:xSimulate,代码行数:4,代码来源:MouseTask.cs


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