i have login page with 2 textbox and 1 button
<input name="txtUserName" type="text" value="666" id="txtUserName" class="textbox">
and
<input name="txtPassword" type="password" id="txtPassword" class="textbox">
and button is like this
<input type="submit" name="LoginButton" value="Login To WebSite" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("LoginButton", "", true, "Login1", "", false, false))" id="LoginButton" class="button" style="font-family:tahoma;font-size:10px;">
i have not source code of web page and only thing that i want to send
my user name andd password and receive is “login is OK or login is
FAIL”
when user enter user name and password and click “Login To WebSite” button ,if user/pass correct user login to page http://example.com/Default.aspx that show user panel and if login fail system show login.aspx again
now i design windows application that have 2 textbox and one button
i want when i click button textbox1 and textbox2 text send to web site as login information and if this data is correct show me message that login is successful and else show me error
When you press “Login To Website” button in ASP.Net it calls the javascript WebForm_DoPostBackWithOptions function.
According to this MSDN Magazine’s article, this function performs a POST operation onto the selected page.
To do that in a Windows application you can use the WebClient class (see the sample code at the bottom of the MSDN page) or a combination of HttpWebRequest and HttpWebResponse.
How to use HttpWebRequest and HttpWebResponse is described in this codeproject article.
Note that I based my answer on this other SO answer.