C # How do I find a form on a web page in C #?

I am writing an application that needs to be able to find a specified URL and then automatically enters a username and password for a form that appears when the website loads.

How can I programmatically achieve this in C #?

0


a source to share


1 answer


You have to do this using System.Net.WebRequest and doing an HTTP POST. An example of this is shown here.



If for some reason this is some weird webpage and POST won't work, another alternative is to use a browser automation framework like http://watin.sourceforge.net/ or WebAii to automate the browser to do this but I don't recommend it unless you really can do it. because it will be slower, probably less reliable and more painful in general.

0


a source







All Articles