怎么样能获取到网页POST传输的数据啊!!
来源:百度知道 编辑:UC知道 时间:2024/06/01 11:49:28
为什么都没人回答啊~!我都提高两次分了~~~~~~~~~~~~~~~救命啊~~~~~~~~~~~~
Encoding code = Encoding.GetEncoding(_input_charset);
string strRequestData = BuildRequestParaToString(sParaTemp, code);
//把数组转换成流中所需字节数组类型
byte[] bytesRequestData = code.GetBytes(strRequestData);
//构造请求地址
string strUrl = gateway + "_input_charset=" + _input_charset;
//请求远程HTTP
XmlDocument xmlDoc = new XmlDocument();
try
{
//设置HttpWebRequest基本信息
HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create(strUrl);
myReq.Method = "post";
myReq.ContentType = "application/x-www-form-urlencoded";
//填充POST数据
myReq.ContentLength = bytesRequestData.Length;
Stream requestStream = myReq.GetRequestStream();
requestStream.Wri