最新下载
热门教程
- 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
相关文章
- 世界之外易遇生日活动怎么玩 12-23
- 无期迷途空条徐伦什么时候复刻 12-23
- 无期迷途黛伦蝶之影怎么样 12-23
- 无期迷途空条承太郎什么时候up 12-23
- 无期迷途艾梅斯怎么样 12-23
- 阴阳师小袖之手幽篁流影怎么样 12-23