很简单,一句话使用System.NET.WebUtility类。它提供HtmlEncode, HtmlDecode, UrlEncode, UrlDecode等方法。
System.NET.WebUtility
HtmlEncode
HtmlDecode
UrlEncode
UrlDecode