HttpUtility.HtmlDecode与Server.HtmlDecode区别
HttpUtility.HtmlDecode
HttpUtility.HtmlEncode
与
Server.HtmlDecode
Server.HtmlEncode
请教一下他们有什么区别,还有HtmlDecode与HtmlEncode分别用在什么场合??????????????
他们与下面一般手工写的代码有什么不一样吗??????????????????
public static string htmlencode(string str)
{
if (str == null || str == "")
return "";
str = str.Replace(">", ">");
str = str.Replace("<", "<");
str = str.Replace(" ", " ");
str = str.Replace(" ", " ");
str = str.Replace("\"", """);
str = str.Replace("\'", "'");
str = str.Replace("\n", "<br/> ");
return str;
}