asp中格式化HTML函数代码 SDCMS加强版
来源:asp之家 时间:2011-02-20 11:18:00
代码如下:
'==============================
'格式化HTML,SDCMS加强版
'==============================
Function Nohtml(ByVal t0)
IF Len(t0)=0 Or IsNull(t0) Then
Nohtml=""
Exit Function
End IF
Dim Regs,Matches,Match
Set Regs=New Regexp
Regs.Ignorecase=True
Regs.Global=True
'过滤掉JS,Iframe
Regs.pattern ="<script.+?/script>"
t0=Regs.Replace(t0,"")
Regs.pattern ="<iframe.+?/iframe>"
t0=Regs.Replace(t0,"")
'再过滤其他
Regs.Pattern="<.+?>"
Set Matches=Regs.Execute(t0)
IF Matches.Count>0 Then
For Each Match In Matches
t0=Replace(t0,Match.value,"")
Next
End IF
t0=Replace(t0," ","")
t0=Replace(t0,vbCrLf,"")
t0=Replace(t0," ","")
t0=Replace(t0," ","")
t0=Replace(t0,CHR(9),"")
t0=Replace(t0,CHR(13),"")
t0=Replace(t0,CHR(10),"")
t0=Replace(t0,CHR(22),"")
Set Regs=Nothing
Nohtml=t0
End Function
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
DW实现鼠标滑过切换图片
![](https://img.aspxhome.com/file/UploadPic/20082/3/200823185431657s.jpg)
如何把图片也存到数据库中去?
2010怎么就宅了——我们是设计星球的阿凡达
![](https://img.aspxhome.com/file/UploadPic/20103/9/1003-2010zai-01-16s.jpg)
ASP基础知识介绍
细化解析:SQL Server 2005 数据库镜像
超级连接的title提示中如何换行实现多行显示
960 时代的终结
![](https://img.aspxhome.com/file/UploadPic/20111/11/1294635311-31s.png)
去掉前面的0的sql语句(前导零,零前缀)
ASP用户登录验证代码
asp连接MYSQL数据库的连接字符串(参数OPTION)
ASP下检测图片木马的函数代码
最新屏蔽百度快照的方法
asp如何实时获知多少人在线?
使用 JSON 进行数据传输
IE下文本被折行的解决方案
有效防止ASP木马上传运行—小知识[网络安全技术]
[翻译]标记语言和样式手册 Chapter 11 打印样式
![](https://img.aspxhome.com/file/UploadPic/20082/11/2008211185712733s.jpg)
用户体验杂谈
![](https://img.aspxhome.com/file/UploadPic/201110/21/1319167746393-76s.jpg)
ASP中使用Session变量的优缺点
利用SQLyogEnt对Mysql数据库进行转移
![](https://img.aspxhome.com/file/UploadPic/20122/25/2012225201930670s.jpg)