private string baiduurl="http://www.abc.com?ee=";
WebClient wClient = new WebClient();
byte[] pageData = wClient.DownloadData(baiduurl +System.Net.WebUtility.HtmlEncode("这汉字要转成gb2312编码怎么转不过来啊");
this.label3.Text = System.Net.WebUtility.HtmlEncode(this.textBox1.Text.ToString());
(中国=%D6%D0%B9%FA)http://www.abc.com?ee=%D6%D0%B9%FA
我想取到搜索后的网页
WebClient wClient = new WebClient();
byte[] pageData = wClient.DownloadData(baiduurl + Server.UrlEncode("中国").ToString());
this.label3.Text = System.Net.WebUtility.HtmlEncode(this.textBox1.Text.ToString());
System.Web.HttpUtility.UrlEncode("", Encoding.GetEncoding("gb2312")).ToUpper();
UrlDecode
在项目中添加引用:System.Web 使用方法:System.Web.HttpUtility.UrlDecode(“中国”);