TextBox保存的文本在Label中显示

private string FormatString(string strValue)
{
      strValue = strValue.Replace(" ", " ");//处理空格  
      strValue = strValue.Replace("<", "&lt;");//处理小于号  
      strValue = strValue.Replace(">", "&gt;");//处理大于号
      strValue = strValue.Replace("\n", "<br/>");//处理换行
      return strValue;
}
原文地址:https://www.cnblogs.com/zhangpengshou/p/869222.html