/// <summary>
/// 替換html中的特殊字元
/// </summary>
/// <param name="theString">需要進行替換的文本。</param>
/// <returns>替換完的文本。</returns>
public string HtmlEncode(string theString)
{
theString=theString.Replace(">", ">");
theString=theString.Replace("<", "<");
theString=theString.Replace(" ", " ");
theString=theString.Replace(" ", " ");
theString=theString.Replace("\"", """);
theString=theString.Replace("\'", "'");
theString=theString.Replace("\n", "<br/> ");
return theString;
}
/// <summary>
/// 恢複html中的特殊字元
/// </summary>
/// <param name="theString">需要恢複的文本。</param>
/// <returns>恢複好的文本。</returns>
public string HtmlDiscode(string theString)
{
theString=theString.Replace(">", ">");
theString=theString.Replace("<", "<");
theString=theString.Replace(" "," ");
theString=theString.Replace(" "," ");
theString=theString.Replace(""","\"");
theString=theString.Replace("'","\'");
theString=theString.Replace("<br/> ","\n");
return theString;
}