#region 将Html特殊字符转义处理
/// <summary>
/// 将Html特殊字符转义处理
/// </summary>
/// <param name="strHC">需要专业的内容</param>
/// <returns></returns>
public static string HtmlCode(string strHC)
{
string strR = string.Empty;
if (string.IsNullOrEmpty(strHC))
return "";
strR = strHC.Replace("&", "&");
strR = strR.Replace(">", ">");
strR = strR.Replace("<", "<");
strR = strR.Replace(" ", " ");
strR = strR.Replace("\n", "<br/>");
strR = strR.Replace("\r", "<br/>");
strR = strR.Replace("\r\n", "<br/>");
strR = strR.Replace("'", "''");
strR = strR.Replace("\"", """);
strR = strR.Replace("#", "");
strR = strR.Replace("%", "");
return strR;
}
#endregion