如何编程没有web浏览器中的一个提交按钮提交表单 [英] How programmatically submit a form without a submit button in WebBrowser

查看:161
本文介绍了如何编程没有web浏览器中的一个提交按钮提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我浏览到一个网站,一个没有提交按钮,但确实有形式的形式。我想提交这种形式。如何使用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");
}

这篇关于如何编程没有web浏览器中的一个提交按钮提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆