如题

解决方案 »

  1.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=YUEMA9OS-W1DN-4KIS-8RIE-S742LLJ91L6Q
    如何在Windows Form中实现URL Encoding/Decoding?  
    如果你想在Windows Forms中实现URL Encoding,HttpUtility类有一个shared (static)方法实现对字符串的URL 编码。下面就是一个例子:【注意要在工程的引用里添加引用System.Web】 
    private void button1_Click(object sender, System.EventArgs e)
    {
    textBox2.Text = System.Web.HttpUtility.UrlEncode(textBox1.Text);}private void button2_Click(object sender, System.EventArgs e)
    {
    textBox3.Text = System.Web.HttpUtility.UrlDecode(textBox2.Text);}
      

  2.   

    要实现与Web页面正常通讯正常解码,则需要
    System.Web.HttpUtility.UrlEncode(strArg, System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()
    就可以实现与百度相同的结果