最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 过滤html代码程序
时间:2022-07-02 23:11:35 编辑:袖梨 来源:一聚教程网
Function TransferHTML(ByVal source,para)
Dim objRegExp
'先换"&"
If Instr(para,"[&]")>0 Then source=Replace(source,"&","&")
If Instr(para,"[<]")>0 Then source=Replace(source,"<","<")
If Instr(para,"[>]")>0 Then source=Replace(source,">",">")
If Instr(para,"[""]")>0 Then source=Replace(source,"""",""")
If Instr(para,"[space]")>0 Then source=Replace(source," "," ")
If Instr(para,"[enter]")>0 Then
source=Replace(source,vbCrLf,"
")
source=Replace(source,vbLf,"
")
End If
If Instr(para,"[vbCrlf]")>0 Then
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="((?form[^n<]*>)|(
source= objRegExp.Replace(source,"$1")
objRegExp.Pattern="(rn|n)"
source= objRegExp.Replace(source,"
")
source=Replace(source,"","")
source=Replace(source,"","")
source=Replace(source,"
source=Replace(source,"","")
End If
If Instr(para,"[vbTab]")>0 Then source=Replace(source,vbTab," ")
If Instr(para,"[no-asp]")>0 Then
source=Replace(source,"<"&"%","<"&"%")
source=Replace(source,"%"&">","%"&">")
End If
If Instr(para,"[nofollow]")>0 Then
source=Replace(source,"
End If
If Instr(para,"[nohtml]")>0 Then
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="<[^>]*>"
source= objRegExp.Replace(source,"")
End If
If Instr(para,"[filename]")>0 Then
source=Replace(source,"/","")
source=Replace(source,"","")
source=Replace(source,":","")
source=Replace(source,"?","")
source=Replace(source,"*","")
source=Replace(source,"""","")
source=Replace(source,"<","")
source=Replace(source,">","")
source=Replace(source,"|","")
source=Replace(source," ","")
End If
If Instr(para,"[normalname]")>0 Then
source=Replace(source,"$","")
source=Replace(source,"(","")
source=Replace(source,")","")
source=Replace(source,"*","")
source=Replace(source,"+","")
source=Replace(source,",","")
source=Replace(source,"[","")
source=Replace(source,"]","")
source=Replace(source,"{","")
source=Replace(source,"}","")
source=Replace(source,"?","")
source=Replace(source,"","")
source=Replace(source,"^","")
source=Replace(source,"|","")
source=Replace(source,":","")
source=Replace(source,"""","")
source=Replace(source,"'","")
End If
If Instr(para,"[textarea]")>0 Then
source=Replace(source,"&","&")
source=Replace(source,"%","%")
source=Replace(source,"<","<")
source=Replace(source,">",">")
End If
If Instr(para,"[html-format]")>0 Then
source=Replace(source,"&","&")
source=Replace(source,"<","<")
source=Replace(source,">",">")
source=Replace(source,"""",""")
End If
If Instr(para,"[anti-html-format]")>0 Then
source=Replace(source,""","""")
source=Replace(source,"<","<")
source=Replace(source,">",">")
source=Replace(source,"&","&")
End If
If Instr(para,"[wapnohtml]")>0 Then
source=Replace(source,"
",vbCrLf)
source=Replace(source,"
",vbCrLf)
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="(<[^>]*)|([^<]*>)"
source= objRegExp.Replace(source,"")
objRegExp.Pattern="(rn|n)"
source= objRegExp.Replace(source,"
")
End If
If Instr(para,"[nbsp-br]")>0 Then
Set objRegExp=New RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
objRegExp.Pattern="<$|<b$|<br$|<br/$"
source= objRegExp.Replace(source,"")
objRegExp.Pattern="^br/>|^r/>|^/>|^>"
source= objRegExp.Replace(source,"")
objRegExp.Pattern="<br/>"
source= objRegExp.Replace(source,"
")
objRegExp.Pattern=" "
source= objRegExp.Replace(source," ")
End If
If Instr(para,"[closehtml]")>0 Then
source=closeHTML(source)
End If
TransferHTML=source
End Function
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22