public Function RSQL(strChar)
# t# m4 ?( L' ^( b" ^$ \& @$ B If strChar = "" or IsNull(strChar) Then RSQL = "":Exit Function
' n3 v: N3 O% _+ ~$ c Dim strBadChar, arrBadChar, tempChar, I0 K3 W4 }1 M8 B4 q* g
strBadChar = "$,#,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""’注意这里过滤的是特殊字符 ‘Chr(34)对应的ASCII码是双引号。Chr(0)其实就是我们上传改包把空格(20)改成的00: \' [/ j- w& f
arrBadChar = Split(strBadChar, ",")
1 ^5 V: e9 f" \) L% ^0 t" M$ ] tempChar = strChar
- r6 r) d' Z7 U# q For I = 0 To UBound(arrBadChar)8 ` ]# q4 Z, U% d( A
tempChar = Replace(tempChar, arrBadChar(I), "") ‘将特殊字符过滤为空
. W* x' m' k4 _+ {1 S+ U1 D Next
0 m( R/ `; m# E7 Q RSQL = tempChar
/ F2 p7 A# D, bEnd Function
4 ^5 V% Z1 C! M W Y) D- I# x |