代码如下:Encoding encoding = Encoding.GetEncoding("GB2312");string postData = "";
// URL
string strUrl = "http://192.168.0.154/oa/login.asp";
postData += ("uid=duan");
postData += ("&pwd=123456");
byte[] data = encoding.GetBytes(postData);// 准备请求...
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(strUrl);
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream=myRequest.GetRequestStream();
// 发送数据
newStream.Write(data,0,data.Length);
newStream.Close();各位看看是不是不能使用这种方法?