Tag: DownloadString
WebClient类对象DownloadString属性出现乱码问题[解决方法]
unvs | ASP.NET | 2012-01-16
使用WebClient类对象的DownloadString属性请求下载内容时,出现乱码,如:{\"content\":\"鍏呭€兼垚鍔?,\"code\":0} ,后面的斜线引号变成问号了。原因:由于返回接受字符串的编码有问题。编码分utf-8、gb2312。解决方法:
WebClient web = new WebClient();//创建一个webclient对象
web.Encoding = System.Text.Encodin... [阅读全文]