string data = "Name=zhoulq&Sex=" + HttpUtility.UrlEncode("男");
byte[] msg=Encoding.UTF8.GetBytes(data);
HttpWebRequest req = HttpWebRequest.Create("http://localhost:1256/Accept.aspx") as HttpWebRequest;
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = msg.Length;
req.Method = "POST";
using (Stream stream=req.GetRequestStream())
{
stream.Write(msg, 0, msg.Length);
}
using (HttpWebResponse rsp = req.GetResponse() as HttpWebResponse)
{
Stream stream=rsp.GetResponseStream();
StreamReader sr = new StreamReader(stream,Encoding.UTF8);
lta.Text = sr.ReadToEnd();
sr.Close();
stream.Close();
}