引用 System.Web
static void Main(string[] args) { // 编码 string urlEncode = System.Web.HttpUtility.UrlEncode("http://www.abc.com/这里是中文测试参数"); Console.Write(urlEncode); // 解码 string urlDecode = System.Web.HttpUtility.UrlDecode("http%3a%2f%2fwww.abc.com%2f%e8%bf%99%e9%87%8c%e6%98%af%e4%b8%ad%e6%96%87%e6%b5%8b%e8%af%95%e5%8f%82%e6%95%b0"); Console.Write(urlDecode); Console.Read(); }