读书人

WINCE下 提交POST的数据服务器如何

发布时间: 2013-10-11 14:52:39 作者: rapoo

WINCE下 提交POST的数据,服务器怎么接收不到
本人开发平台wince,开发软件vs2005.最近想在wince上发送请求到服务器,但是服务器却接收不到我的post数据,我的代码如下:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(Url));

byte[] Eparam = Encoding.ASCII.GetBytes(postDATE); // 转化
MessageBox.Show(Encoding.ASCII.GetString(Eparam, 0, Eparam.Length));

request.Method = "post";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = Eparam.Length;

Stream questStream = null;
try
{
questStream = request.GetRequestStream();
questStream.Write(Eparam, 0, Eparam.Length);
questStream.Flush();
}
//处理异常
catch (Exception ex)
{
return ex.Message.ToString();
}
finally
{
questStream.Close();
}
请求大侠。告知原因。
[解决办法]
接分,我喜欢

读书人网 >C#

热点推荐