利用ASP.NET怎么对HTML字符串进行过滤-创新互联
这期内容当中小编将会给大家带来有关利用ASP.NET怎么对HTML字符串进行过滤,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
具体代码如下:
///去除HTML标记 /// /// /// 包括HTML的源码 ///已经去除后的文字 public static string GetNoHTMLString(string Htmlstring) { //删除脚本 Htmlstring = Regex.Replace(Htmlstring, @"", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?>.*?", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?>.*? ", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?>.*?", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?>.*? ", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?>.*?", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"", "", RegexOptions.IgnoreCase); return str; }
本文名称:利用ASP.NET怎么对HTML字符串进行过滤-创新互联
网页地址:http://scfushun.com/article/gsosd.html