最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP特殊字符过滤
时间:2022-07-02 23:58:30 编辑:袖梨 来源:一聚教程网
哎,好久没有写东西了,老师这次又来说让我再测试测试自己的东西,发现有特殊字符过滤不严的问题,所以又重新写了一个函数过滤特殊字符的。
Function ChkInvaildWord(Words)
Const InvaildWords="select|update|delete|insert|@|--|," '需要过滤得字符以“|”隔开,最后结束的字符必须是|
ChkInvaildWord=True
InvaildWord=Split(InvaildWords,"|")
inWords=LCase(Trim(Words))
For i=LBound(InvaildWord) To UBound(InvaildWord)
If Instr(inWords,InvaildWord(i))>0 Then
ChkInvaildWord=True
Exit Function
End If
Next
ChkInvaildWord=False
End Function
比较简单,使用方法就不说了。
不过开始时准备用for each ...next写得,但是不知道为什么就是不对,所以改用了for 循环了,感觉不适很到,但是可以使用!
(ps: 今天又头痛了一整天了,不知道什么时候这个该死的头痛病能好,要不然,明天的工作我可就残了!期待明天会有一个好状态!)
Function ChkInvaildWord(Words)
Const InvaildWords="select|update|delete|insert|@|--|," '需要过滤得字符以“|”隔开,最后结束的字符必须是|
ChkInvaildWord=True
InvaildWord=Split(InvaildWords,"|")
inWords=LCase(Trim(Words))
For i=LBound(InvaildWord) To UBound(InvaildWord)
If Instr(inWords,InvaildWord(i))>0 Then
ChkInvaildWord=True
Exit Function
End If
Next
ChkInvaildWord=False
End Function
比较简单,使用方法就不说了。
不过开始时准备用for each ...next写得,但是不知道为什么就是不对,所以改用了for 循环了,感觉不适很到,但是可以使用!
(ps: 今天又头痛了一整天了,不知道什么时候这个该死的头痛病能好,要不然,明天的工作我可就残了!期待明天会有一个好状态!)
相关文章
- 《雷霆战机集结》巡航模式攻略 06-16
- 《雷霆战机集结》装备/驾驶员/源晶养成攻略 06-16
- Solana因伊朗-以色列动荡遭受重创——SOL价格会持续下跌吗? 06-16
- 《雷霆战机集结》Boss模式关卡刷取建议 06-16
- 《世界启元》S6赛季芝诺周瑜队搭配攻略 06-16
- 《世界启元》S6赛季新英雄达尔文技能分析及配队推荐 06-16