|
1金钱
string param = "uint=xxxxx&window=xxx";
byte[] bs = Encoding.ASCII.GetBytes(param);
HttpWebRequest req =
(HttpWebRequest)HttpWebRequest.Create(
UpLoadUrl);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = bs.Length;
//req.Headers.Add("unit_id","1");
Stream reqStream = req.GetRequestStream();
reqStream.Write(bs, 0, bs.Length);
WebResponse webRespon = req.GetResponse();
Stream s = webRespon.GetResponseStream();
StreamReader sr = new StreamReader(s);
//读取服务器端返回的消息
String sReturnString = sr.ReadLine();
MessageBox.Show(sReturnString);
s.Close();
sr.Close();
这样写有问题嘛
|
|