URL 编码
//按照UTF-8进行编码 string tempSearchString1 = System.Web.HttpUtility.UrlEncode("C#中国"); Response.Write(tempSearchString1); Response.Write(HttpUtility.UrlDecode(tempSearchString1)); //按照GB2312进行编码 string tempSearchString2 = System.Web.HttpUtility.UrlEncode("C#中国", System.Text.Encoding.GetEncoding("GB2312")); Response.Write(tempSearchString2); Response.Write(HttpUtility.UrlDecode(tempSearchString2, System.Text.Encoding.GetEncoding("GB2312")));