Sub ChkRiskStr(Str,Risk)
'参数说明,Str为要检查的字符串,Risk为危险字符
For i=0 to UBound(Split(Risk,","))
if Instr(Str,Split(Risk,",")(i))<>0 Then
Response.Write "含用非法字符!"
Response.End
End if
Next
End Sub
调用:
Call ChkRiskStr("abck@$","!@#$%^&*")
代码很简单,短短几行,希望读者能够抛砖引玉,写出更好的代码:)
本文地址:http://com.8s8s.com/it/it8937.htm