How do you click a button in a webbrowser control?

后端 未结 3 1222
遇见更好的自我
遇见更好的自我 2020-11-29 20:03

For example, using code and no user input, how would I have my program click the \"Search\" button on google (assuming I\'ve already filled in the search box and am at googl

3条回答
  •  清酒与你
    2020-11-29 20:30

    In addition to using InvokeMember and others, if your web page has issues responding when called by ID or Class, you can try using {TAB} & {ENTER} using the SendKeys class within .NET. I've written a lot of scripts for web pages and have found that I've had to use a combination of both (even though SendKeys is far messier than the methods in @AleWin's answer).

    Here is the link to the SendKeys class.

提交回复
热议问题