I am writing an application that needs to be able to locate to a specified URL and then automatically enter a username and password for the form that pops up when the website is loaded.
How can I programmatically achieve this in C#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be able to do this using System.Net.WebRequest and doing an HTTP POST. Here is an example of this being done.
If for some reason this is some strange web page and the POST won’t work the other alternative is to use a browser automation framework like http://watin.sourceforge.net/ or WebAii to automate a browser to do this but I don’t recommend this unless you really can’t so it any other way because it will be slower, likely less robust and is more of a pain in general.