函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: _g~2R#2Q
?E6^!4=,
字符类型的 (-,>qMQs
strUsername = CheckInput(Request(“username“),“s“) D SvmVI
数字类型的 yI&9\fn
ID = CheckInput(Request(“id“),“i“) >{wuEPA
U6<M/>RG$
下面是函数 d`mD!)j
96c?3ya
{L].T#
Function CheckInput(str,strType) rh66_eV
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 -}P7$|O&
参数意义: str ---- 要过滤的参数 ]W/>Ldv
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i 9gy(IRGq/
Dim strTmp le8 #Z}p
strTmp = L0L2Ns
If strType =s Then M/pMs 6
strTmp = Replace(Trim(str),,) 0mTr-`s
ElseIf strType=i Then xR?V,uV'$&
If isNumeric(str)=False Then str=0 Xh
F_]
strTmp = str D<>@
%"%
Else XRxj W
strTmp = str `:p1&OS
End If KnGTcoXg_
CheckInput = strTmp tlQC6Fb#
End Function ?2 f_aY ;
'1Y\[T*
^AL2H'
X:|8vS+0gU
转自: ASP教程采集