函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: =c8xg/
nc4KeEl
字符类型的 #{-B`FAQ
strUsername = CheckInput(Request(“username“),“s“) J!YB_6b
数字类型的 5%Hw,h
ID = CheckInput(Request(“id“),“i“) qT5q3 A(8
Bi:%}8STH
下面是函数 ]
-iMo4H
avxr|uk
9kZ[Z
,=>
Function CheckInput(str,strType) EhB0w; c
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 ;&RBg+Pr
参数意义: str ---- 要过滤的参数 %{Ib
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i "MM)AY*b
Dim strTmp <A@}C+
strTmp = e98f+,E/
If strType =s Then .FYxVF.
strTmp = Replace(Trim(str),,) w#0/&\b=
ElseIf strType=i Then ~}Xd{afo
If isNumeric(str)=False Then str=0 Kg?(Ax4
strTmp = str "Te[R%aP
Else PuO5@SP~
strTmp = str N)CM^$(T|
End If 2 8>
CheckInput = strTmp uC$!|I
End Function lZ gX{
r`-=<@[
5!-+5TJI
ZP-^10
转自: ASP教程采集