当前位置: 代码迷 >> ASP.NET >> HttpWebRequest乱码有关问题
  详细解决方案

HttpWebRequest乱码有关问题

热度:9289   发布时间:2013-02-25 00:00:00.0
HttpWebRequest乱码问题?
HttpWebRequest rqst = (HttpWebRequest)WebRequest.Create(Url);
  HttpWebResponse rsps = (HttpWebResponse)rqst.GetResponse();
  Stream sm = rsps.GetResponseStream();
  s = new StreamReader(sm, Encoding.GetEncoding("")).ReadToEnd();
  return s;

href=ClassList.aspx?classcode=200002&ClassName=鏈嶈?淇℃伅&page=163>最后页 只有classname参数后才出现乱码?请问如何解决?

------解决方案--------------------------------------------------------
C# code
s = new StreamReader(sm, Encoding.GetEncoding("")).ReadToEnd(); 把以上这段代码改成s = new StreamReader(sm, System.Text.Encoding.Default).ReadToEnd();
  相关解决方案