相关疑难解决方法(0)

如何以编程方式单击按钮 - WebBrowser(IE)中的按钮

我在互联网上搜索了一些例子;

"如何在C#中单击webBrowser(Internet Explorer)中的按钮?"

这是在谷歌工作的代码;

JS:

    void ClickButton(string attribute, string attName)
    {
        HtmlElementCollection col = webBrowser1.Document.GetElementsByTagName("input");
        foreach (HtmlElement element in col)
        {
            if (element.GetAttribute(attribute).Equals(attName))
            {
                element.InvokeMember("click");   // Invoke the "Click" member of the button
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

但我的网页按钮有不同的标签.因此程序无法检测到单击它.

我的主要问题是; 如何以编程方式单击按钮?

HTML:

<a class="orderContinue" href="Addresses" title="Sipar Ver">Sipar Devam</a>
Run Code Online (Sandbox Code Playgroud)

html c#

4
推荐指数
1
解决办法
7947
查看次数

标签 统计

c# ×1

html ×1