111,125
社区成员
发帖
与我相关
我的任务
分享
使用 GET 方式提交中文数据, 编码方式要以目标的网站为标准。 常用的有 gb2312 和 utf8 两种,如:
Encoding mEncoding = Encoding.GetEncoding("gb2312");
string strUrl = "http://192.168.1.1/userRpm/StatusRpm.htm?connect=" + HttpUtility.UrlEncode("连 接", mEncoding);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(strUrl);
req.Method = "GET";
using (WebResponse wr = req.GetResponse())
{
}