通过本文主要向大家介绍了html5 asp.net,html asp.net,asp.net,asp net培训,asp和asp.net的区别等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
/// <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;
}
</div>
/// 替换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;
}
</div>
您可能想查找下面的文章:
- asp.net动态生成HTML表单的方法
- 解读ASP.NET 5 & MVC6系列教程(17):MVC中的其他新特性
- 解读ASP.NET 5 & MVC6系列教程(16):自定义View视图文件查找逻辑
- 解读ASP.NET 5 & MVC6系列教程(15):MvcOptions配置
- 解读ASP.NET 5 & MVC6系列教程(14):View Component
- 解读ASP.NET 5 & MVC6系列教程(13):TagHelper
- 解读ASP.NET 5 & MVC6系列教程(12):基于Lamda表达式的强类型Routing实现
- 解读ASP.NET 5 & MVC6系列教程(11):Routing路由
- 解读ASP.NET 5 & MVC6系列教程(10):Controller与Action
- 解读ASP.NET 5 & MVC6系列教程(9):日志框架