C# How to Click Button automatically via WebBrowser

后端 未结 5 2116
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 08:19

The Html code of my click page is :



        
5条回答
  •  借酒劲吻你
    2020-12-05 08:48

    Try a combination of @adam's suggestion and capitalize Click

    private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        webBrowser1.Document
            .GetElementById("ctl00_main_LoginExpoPlanIt_LoginButton")
            .InvokeMember("Click");
    }
    

    Just tested this and it didn't work with "click" but did with "Click" :)

    I'm using .net 4

提交回复
热议问题