How can I create a program with C# to submit the form(in the web browser CONTROL in windows Apps)automaticlly ?
To do so, right-click on the WebBrowser control, and select Properties. This action launches the Properties window. Feel free to set any properties you like. The Url property represents the web page a WebBrowser displays.
The WebBrowser control provides a managed wrapper for the WebBrowser ActiveX control. The managed wrapper lets you display Web pages in your Windows Forms client applications.
The WebBrowser control has a Document property, which returns an HtmlDocument. The HtmlDocument has several members you can use to traverse and manipulate the DOM.
Once you've used these methods to find the form, you can use InvokeMember to call the form's submit method.
If you know the page has a single form:
foreach (HtmlElement form in webBrowser1.Document.Forms)
form.InvokeMember("submit");
If you know the ID of the form you would like to submit:
HtmlElement form = webBrowser1.Document.GetElementById("FormID");
if (form != null)
form.InvokeMember("submit");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With