函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: +ZRm1q
/(i~Hpp
字符类型的 @9MrTP
strUsername = CheckInput(Request(“username“),“s“) EFs\zWF
数字类型的 4ug4[
ID = CheckInput(Request(“id“),“i“) j!a&l
dp:5iuS
下面是函数 /IC]}0kkp
4o@^._-R
yLt>OA<X
Function CheckInput(str,strType) yIS&ZtBA
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 q4u-mM7#7
参数意义: str ---- 要过滤的参数 _6yrd.H
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i ~@iYP/=/Q
Dim strTmp 1,6Y)_
strTmp = m=]}Tn
If strType =s Then *@&V=l
strTmp = Replace(Trim(str),,) "6iq_!#L
ElseIf strType=i Then JWQ.Efe
If isNumeric(str)=False Then str=0 A2B]E,JMp
strTmp = str [g:KFbEY
Else PMiG:bM
strTmp = str sAPYQ
End If Ak2Vf0E b
CheckInput = strTmp 6Kd,(DI
End Function "o<&3c4
&s&Ha{(!w
SS-7y:6y>
e\]CZ5hs3
转自: ASP教程采集