[C#] 纯文本查看 复制代码 {
URL = posturl,
Method = "post",//URL 可选项 默认为Get
Encoding = Encoding.GetEncoding("GBK"),//编码格式(utf-8,gb2312,gbk) //Encoding = Encoding.UTF8,
Expect100Continue = false,
//ResultType = ResultType.Byte
}; item.Cookie = this.Cookie;
item.ContentType = "application/x-www-form-urlencoded";
item.Postdata = Encoding.Default.GetString(postdata); //这里的postdata是个byte[],我转换成了string。
HttpResult result = http.GetHtml(item);
Console.WriteLine(result.Html);
string html = result.Html;
err = GetserverErr(html, "产品已成功提交");
网站是utf-8的, 我设置Encoding.UTF8,发送数据。在网站上看,所有中文都乱码了。这个怎么办呢。换成gbk,也是乱码。怎么搞呢
|