WebRequest请求Url中文乱码

出现这种情况需要对请求的URL进行编码转换,如下:

string url="...";

Encoding encode = System.Text.Encoding.GetEncoding("gb2312");

url = System.Web.HttpUtility.UrlEncode(url, encode);

 

posted @ 2014-06-23 10:12  chenlh  阅读(488)  评论(0编辑  收藏  举报