页面
http://q.blog.sina.com.cn/search_result.php?searchtype=9&sort=0&searchtext=%BC%F5%B7%CA其中:%BC%F5%B7%CA对应的是减肥,如何把减肥转换为:%BC%F5%B7%CA谢谢

解决方案 »

  1.   

    没有明白?是取得:%BC%F5%B7%CA 吗?
      

  2.   

    如果要转换成中文的话
    就HttpUtility.UrlDecode("%BC%F5%B7%CA ");
      

  3.   

    想把“减肥”转换为"%BC%F5%B7%CA ";用:System.Web.HttpUtility.UrlEncode(“减肥”)得出来的结果不对啊
      

  4.   


    string str=System.Web.HttpUtility.UrlDecode("%BC%F5%B7%CA", Encoding.GetEncoding("GB2312"));
    str= System.Web.HttpUtility.UrlEncode("减肥", Encoding.GetEncoding("GB2312"));
      

  5.   

    正常的写法就是:str= System.Web.HttpUtility.UrlEncode("减肥", Encoding.GetEncoding("GB2312"));string str=System.Web.HttpUtility.UrlDecode("%BC%F5%B7%CA", Encoding.GetEncoding("GB2312"));要是出来的值不是"%BC%F5%B7%CA"那就说明新浪的"%BC%F5%B7%CA" 肯定是加密过的.
      

  6.   


    string str=System.Web.HttpUtility.UrlDecode("%BC%F5%B7%CA", Encoding.GetEncoding(936));
    str= System.Web.HttpUtility.UrlEncode("减肥", Encoding.GetEncoding(936));这样的用法更精确,936就是gb2312的CodePage