public Function RSQL(strChar)
- \" a, ~$ q/ v$ V/ @1 g8 ?6 p' P If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function e6 ~4 j+ \" u$ i& T
Dim strBadChar, arrBadChar, tempChar, I
! b/ D3 I' ~6 H/ d: g strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00
: R5 p8 v# E' Y7 U4 y- v arrBadChar = Split(strBadChar, ","): `/ Q2 E! b* A* N' ~$ ]4 C4 k9 V
tempChar = strChar! p& T, v4 b" j x# }8 K
For I = 0 To UBound(arrBadChar)
& E, {9 a+ S% d; [! X5 w* I tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空* d- [; ^0 N) n# n3 n
Next; I7 p7 r6 S- \. l& y# @
RSQL = tempChar
; M' ^* `) R& G+ [4 a; nEnd Function
) Z( u6 Z: n! b" r! L |