复制代码 代码如下:
///
///替换html中的特殊字符
///
///
///
public static string HtmlEncode(string theString)
{
theString=theString.Replace(">",">");
theString=theString.Replace("<","<");
theString=theString.Replace(" "," ");
theString=theString.Replace(""",""");
theString = theString.Replace("'", "'");
theString=theString.Replace("n","
");
return theString;
}
///
///恢复html中的特殊字符
///
///
///
public static string HtmlDiscode(string theString)
{
theString=theString.Replace(">",">");
theString=theString.Replace("<","<");
theString=theString.Replace(" "," ");
theString=theString.Replace(""",""");
theString = theString.Replace("'", "'");
theString=theString.Replace("
","n");
return theString;
}



