日期:2014-05-17 浏览次数:20446 次
if (HttpWResp.ContentEncoding.ToLower().Contains("gzip"))
{
using (GZipStream stream = new GZipStream(HttpWResp.GetResponseStream(), CompressionMode.Decompress))
{
using (reader = new StreamReader(stream, System.Text.Encoding.GetEncoding("gb2312")))
{
result = reader.ReadToEnd();
//return HttpUtility.HtmlDecode(result);
}
}
}
else
{
Stream myStream = HttpWResp.GetResponseStream();
using (reader = new StreamReader(myStream, System.Text.Encoding.GetEncoding("gb2312")))
{
result = reader.ReadToEnd();
}
}