try {
string uriString =
"表单地址"; WebClient myWebClient =
new WebClient();
string postData =
"subject=aaaaa&message=bbbbbbb&formhash=91e2aabd"; myWebClient.Headers.Add(
"Content-Type",
"application/x-www-form-urlencoded"); myWebClient.Headers.Add(
"Cookie",
"cdb_sid=nNvaG8; cdb_cookietime=2592000;cdb_auth=UVMEAVcABlpWVQZVUwxTVQwFXAoMVAgEUQMKUQUFAgtqawc;");
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(postData);;
byte[] responseArray = myWebClient.UploadData(uriString,
"POST",byteArray);
string resp = System.Text.Encoding.GetEncoding(
"gb2312").GetString(responseArray); textBox1.Text = resp; }
catch(Exception ex) { MessageBox.Show(ex.Message); }