函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: _,S
L;*G4|
y,I ?3p|S
字符类型的 r&^LSTU0!
strUsername = CheckInput(Request(“username“),“s“) (``EBEn
数字类型的 <p_r{
ID = CheckInput(Request(“id“),“i“) j/I^\Ms
'g3!SdaLF
下面是函数 PQ}q5?N
|~QHCg<
a[Q\8<
Function CheckInput(str,strType) Z^Y_+)=s
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 ^]iIvIp
参数意义: str ---- 要过滤的参数 {|Ew]Wq
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i desrKnY
Dim strTmp :o!bz>T
strTmp = *-KgU'u?
If strType =s Then O'5xPJ
strTmp = Replace(Trim(str),,) 6\8
lx|w
ElseIf strType=i Then Vl91I+Ev
If isNumeric(str)=False Then str=0 Ww8C}2g3
strTmp = str {J`]6 ba
Else LyEM^d]
strTmp = str D{%l 4og
End If D1Yc_
CheckInput = strTmp :/F=j;o
End Function Eb9 eEa<W
%/b3G*$W
*2K/)(
7d44i
转自: ASP教程采集