函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: Ji)Ys
ebV
(L<qJd1Q
字符类型的 dt|| nF
strUsername = CheckInput(Request(“username“),“s“) ZA+w7S3
数字类型的 .]w=+~h
ID = CheckInput(Request(“id“),“i“) K1$
("KtJ
下面是函数 Bwl@Muw
6UKZ0~R
5=_bK^Am
Function CheckInput(str,strType) Tx>V$+al
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 {n\Ai3F-
参数意义: str ---- 要过滤的参数 gY&WH9sp?9
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i s[bQO1g;*
Dim strTmp \IaUsx"#o{
strTmp = I%:\"g"c
If strType =s Then U#Wg"W{
strTmp = Replace(Trim(str),,) b/"gUYo
ElseIf strType=i Then >@)p*y.K
If isNumeric(str)=False Then str=0 $f?GD<}?7r
strTmp = str 5=&ME(fmV
Else c!ieN9^+
strTmp = str J9-n3o
End If X;]Ijha<*
CheckInput = strTmp MfZamu5+F
End Function bae;2| w
^Na3VP
M}e}3w
'*B%&QC-
转自: ASP教程采集