title: Login to the other Website using ASP.net
body: <p>i tried many times using httprequest but not working...
  here my code</p>
  
  <pre><code>//POSTDATA=inputUserName=dmsang&amp;inputPassword=123456789
  string strURL;
  string strPostData = "";
  string strResult;
  HttpWebResponse webrespond;
  HttpWebRequest webresquest;
  StreamReader sr;
  StreamWriter sw;
  
  //======================================
  
  //string a = form1.FindControl("chogochu");
  
  //set url to post
  strURL = "http://up.4share.vn/?act=login";
  
  //post some data        
  strPostData = "inputUserName=dmsang&amp;inputPassword=123456789";
  
  webresquest = (HttpWebRequest)WebRequest.Create(strURL);
  webresquest.Method = "POST";
  webresquest.Referer = strURL;
  webresquest.ContentType = "application/x-www-form-urlencoded";
  webresquest.ContentLength = strPostData.Length;
  
  //post data
  sw = new StreamWriter(webresquest.GetRequestStream());
  sw.Write(strPostData);
  sw.Close();
  
  //read the returned data
  webrespond = (HttpWebResponse)webresquest.GetResponse();
  sr = new StreamReader(webrespond.GetResponseStream());
  strResult = sr.ReadToEnd();
  sr.Close();
  
  //write the result
  TextBox1.Text = strResult;
  </code></pre>
  
  <p>if Location in Response Header = /?act=accinfo is Login Successful</p>