#region 将HTML代码格式化成文本框中输入的文字格式
///
/// 将HTML代码格式化成文本框中输入的文字格式
///
///
///
public static String ToHtml(string Input)
{
StringBuilder sb = new StringBuilder(Input);
sb.Replace("&", "&");
sb.Replace("
sb.Replace(">", ">");
sb.Replace("/r/n", "
");
sb.Replace("/n", "
");
sb.Replace("/t", " ");
sb.Replace("'", "'");
//sb.Replace(" ", " ");
return sb.ToString();
}
///
///转换空格符、换行符为HTML字符
///
/// 需要转换的字符
///
public static string StrToHtml(string strContent)
{
strContent = strContent.Replace("/r/n", "
");
strContent = strContent.Replace("/n", "
");
strContent = strContent.Replace(@"/s", " ");
return strContent;
}
#endregion