Encoding encoding = Encoding.GetEncoding("GB2312");
string postData = "u1=http%3A%2F%2Fq-zone.qq.com%2Ffcg-bin%2Fportal%2Fcgi_web_userinfo.fcg&fp=loginerroralert&u="+textBox1.Text+"&p="+textBox2.Text+"&verifycode="+textBox3.Text+"&Submit3.x=40&Submit3.y=4";
//postData = HttpUtility.UrlEncode(postData,encoding);
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://ptlogin.qq.com/login");
byte[] data = encoding.GetBytes(postData);
myRequest.Method = "POST";

myRequest.Timeout = 10000;

myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
myRequest.CookieContainer = new CookieContainer();
myRequest.CookieContainer.Add(cookie);
try
{
Stream newStream=myRequest.GetRequestStream();
// 发送数据

newStream.Write(data,0,data.Length);

newStream.Close();
}
catch(Exception ee)
{
MessageBox.Show(ee.Message);
}
做个模拟网站登陆qqzone的,以前也作过类似的一点问题没有,这次用抓包程序看了以后发现post的数据根本没有发,只有一些包头数据发出去了,cookie也没发,不知道怎么回事,高手指教了~~想自己搞定无能为力