惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
人人都是产品经理
人人都是产品经理
小众软件
小众软件
博客园 - Franky
WordPress大学
WordPress大学
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
博客园 - 【当耐特】
IT之家
IT之家
G
Google Developers Blog
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
V
Visual Studio Blog
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
GbyAI
GbyAI
雷峰网
雷峰网

博客园 - 一滴海水

没文化真可怕,一个IIS7.5不能打开“默认文档”的问题,折腾半天 VS 2010 因为此版本的应用程序不支持其项目类型(.csproj)”的解决办法 使用Frame引用跨域站点页面时,Session失效问题解决方案 注册EXE文件为Windows服务.txt 常用正则表达式例子 (C#)Windows Shell 外壳编程系列 - ContextMenu 注册文件右键菜单 偶尔出现 指定 网络名不再可用 错误提示 MS-SQL Server 基础类(尤其是在文件下载时) - 一滴海水 在EXCEL中明明有值,却说值为空? 无法访问windows installer服务怎么办 System.Exception: System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本 如何在win2003下安装sql2008[多次安装sql2008失败者必看] DataList做无间隔滚动 横向 - 一滴海水 - 博客园 [转]桌面轻量级数据库的选择:Access、SQLite、自己编写? WIN2003下IIS(WEB服务器)的负载均衡 如何设置IIS7支持ASP? - 一滴海水 - 博客园 DataTable复制DataRow的方法 关于在asp.net 网站应用程序中添加.ashx文件的问题。 <meta http-equiv="X-UA-Compatible" content="IE=7" />的意思:将IE8使用IE7进行渲染,使网站在IE8上显示正常 - 一滴海水 “HtmlSelect”不能有类型为“DataBoundLiteralControl”的子级。
C# 过滤脚本_ - 一滴海水 - 博客园
一滴海水 · 2009-09-17 · via 博客园 - 一滴海水

System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"<script[\s\S]+</script *>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
             System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@" href *= *[\s\S]*script *:",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
             System.Text.RegularExpressions.Regex regex3 = new System.Text.RegularExpressions.Regex(@" on[\s\S]*=",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
             System.Text.RegularExpressions.Regex regex4 = new System.Text.RegularExpressions.Regex(@"<iframe[\s\S]+</iframe *>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
             System.Text.RegularExpressions.Regex regex5 = new System.Text.RegularExpressions.Regex(@"<frameset[\s\S]+</frameset *>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
             string html=textBox2.Text;
             html = regex1.Replace(html, ""); //过滤<script></script>标记
             html = regex2.Replace(html, ""); //过滤href=javascript: (<A>) 属性
             html = regex3.Replace(html, " _disibledevent="); //过滤其它控件的on...事件
             html = regex4.Replace(html, ""); //过滤iframe
             html = regex5.Replace(html, ""); //过滤frameset