Possible Duplicate:
How to simulate browser HTTP POST request and capture result in C#
I have the following form in my web page…
<input type="text" tabindex="1" id="username" name="username" size="30"/>
<input type="password" tabindex="2" id="password" name="password" size="30"/>
I use these to log into my website.
But I want to provide this functionality in my application as well.
How do I use a HTTP web request to send the user and password to my verification page?
Scott Hanselman has a great post about this:
http://www.hanselman.com/blog/HTTPPOSTsAndHTTPGETsWithWebClientAndCAndFakingAPostBack.aspx
(quite similar to @The Mask response, but a bit more verbose on the explanation)