|
算了 我去说服一下BOSS 让他用程序吧--! 我连程序都写好了- -~ 可怜的ASP程序- -~!~~~~~ '编写者:逸风 '编写日期:2008-6-4 '函数说明:对非法字符进行过滤 '这个函数将过滤所有非中文字符 function ClearString(str) dim re,str1,str2,i set re = new regexp re.Pattern = "^[\u4e00-\u9fa5\s\n\r\t]+$" for i=1 to len(str) str1 = mid(str,i,1) clearString = re.Test(str1) if clearString=true then str2 = str2&str1 end if next str=str2 ClearString = str end function '编写者:逸风 '编写日期:2008-6-4 '函数说明:对非法字符进行过滤 '这个函数将过滤所有非中文字符 function KillKey(str) Key="枪支,走私,贩毒" KeyArray=split(Key,",") K=ubound(KeyArray) for i=0 to K if Instr(str,KeyArray(i)) then response.Write(" <font color=red>您好,您输入的字符包含非法字符,请您仔细检查后再提交! </font> <a href='javascript:history.go(-1);'>返回 </a> <br/>非法字符:" & KeyArray(i)) response.End() end if next end function
|