Postcode
Protected void button#click (Object sender, eventargs E)
{
String Strid = "button ";
String strpassword = "123456 ";
Asciiencoding encoding = new asciiencoding ();
String postdata = "_ eventtarget = & __ eventargument = & __ viewstate = % response & __ previouspage = wVE_UGSoWjG65-rQk8wSB2QnduBi7s5pGYGv9nl2ZQU1 & __ eventvalidation = % response % 2b0ab8qq & button2 =" + Strid;
Postdata + = ("& textbox1 =" + strpassword );
Byte [] DATA = encoding. getbytes (postdata );
// Prepare Web Request
Httpwebrequest myrequest = httpwebrequest. Create ("http: // localhost: 1222/normalprojectsite/targetpost. aspx") as httpwebrequest;
Myrequest. method = "Post ";
Myrequest. contenttype = "application/X-WWW-form-urlencoded ";
Myrequest. contentlength = data. length;
Stream newstream = myrequest. getrequeststream ();
// Send the data.
Newstream. Write (data, 0, Data. Length );
Newstream. Close ();
// Get Response
Httpwebresponse myresponse = (httpwebresponse) myrequest. getresponse ();
Streamreader reader = new streamreader (myresponse. getresponsestream (), encoding. Default );
String content = reader. readtoend ();