如何编程没有web浏览器中的一个提交按钮提交表单表单、按钮、器中、web

2023-09-02 10:40:10 作者:如初不遇

我浏览到一个网站,一个没有提交按钮,但确实有形式的形式。我想提交这种形式。如何使用C#和WebBrowser控件做到这一点?

I navigated to a website with a form that has no submit button but does have form. I would like to submit this form. How to do this using C# and WebBrowser control?

推荐答案

试试这个(或类似的东西):

Try this (or something like it):

HtmlElementCollection elements = this.webBrowserControl.Document.GetElementsByTagName("Form");  

foreach(HtmlElement currentElement in elements)
{
    currentElement.InvokeMember("submit");
}