首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

直接在ie地址输入带中文参数可以显示xml数据,这样就的话就取不到xml数据。该如何处理

2012-04-17 
直接在ie地址输入带中文参数可以显示xml数据,这样就的话就取不到xml数据。System.Net.WebClient wc new S

直接在ie地址输入带中文参数可以显示xml数据,这样就的话就取不到xml数据。
System.Net.WebClient wc = new System.Net.WebClient();
  string url1 = "http://find.com:6777/xml/news//getnews.asp?ex=10&kw=你好";
  Uri u = new Uri(url1);
  byte[] b = wc.DownloadData(u);
  string responseBody = System.Text.Encoding.GetEncoding("gb2312").GetString(b);
  System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
  xml.LoadXml(GetURLResult(url1));

直接在ie地址输入带中文参数可以显示xml数据,这样就的话就取不到xml数据。怎么编码什么的都不行阿 

各位有什么好办法吗

[解决办法]
将url 编码

热点排行
Bad Request.