Posting a Form through programatically using Windows Form in C sharp
<p>Is it possible to Post some data from window based app to a web-server ? Lets be practical</p>

<pre><code>ASCIIEncoding encodedText = new ASCIIEncoding();
string postData = string.Format("txtUserID={0}&amp;txtPassword={1}", txtUName.Text, txtPassword.Text);
byte[] data = encodedText.GetBytes(postData);
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://www.aimlifes.com/office/Login.aspx");
webRequest.Method = "POST";
webRequest.ContentType = "text/html";
webRequest.ContentLength = data.Length;
Stream strm = webRequest.GetRequestStream();
strm.Write(data, 0, data.Length);

txtUrlData.Text = GetPageHtml("http://www.aimlifes.com/office/ReceiveRecharge.aspx");

strm.Close();
</code></pre>

<p>GetPageHtml Function:</p>

<pre><code>public string  GetPageHtml(String Url)
{
  WebClient wbc = new WebClient();
  return new System.Text.UTF8Encoding().GetString(wbc.DownloadData(Url));
}
</code></pre>

<p>What i'm trying is Login To xyz.com site using given credential and fetch the html data in a TextArea. <code>GetPageHtml()</code> function fetch's the html data. But the main problem is Posting the login details is not working, i mean m not able to get login to the xyz.com</p>
