Fction CheckStr(Strer,Num) Dim Shield,w If Strer = "" Or IsNull(Strer) Then Exit Function Select Case Num Case 1 If IsNumeric(Strer) = 0 Then Response.Write "操作错误" Response.End End If Strer = Int(Strer) End Select CheckStr = Strer End Function Sub DoDelslhtml(htmlname) On Error Resume Next Set fso = Server.CreateObject("Scripting.FileSystemObject") servermap=server.MapPath("..") servermap=servermap&"\"&htmlname FSO.DeleteFile(servermap) Set FSO = Nothing End Sub Function ReplaceBadChar(strChar) If strChar = "" Or IsNull(strChar) Then ReplaceBadChar = "" Exit Function End If Dim strBadChar, arrBadChar, tempChar, i strBadChar = "+,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ",--" arrBadChar = Split(strBadChar, ",") tempChar = strChar For i = 0 To UBound(arrBadChar) tempChar = Replace(tempChar, arrBadChar(i), "") Next tempChar = Replace(tempChar, "@@", "@") ReplaceBadChar = tempChar End Function Function ReplaceConstChar(strChar) If strChar = "" Or IsNull(strChar) Then ReplaceConstChar = "" Exit Function End If Dim strBadChar, arrBadChar, tempChar, i strBadChar = "+,',%,^,&,?,(,),<,>,[,],{,},," & Chr(0) & "" arrBadChar = Split(strBadChar, ",") tempChar = strChar For i = 0 To UBound(arrBadChar) tempChar = Replace(tempChar, arrBadChar(i), "") Next tempChar = Replace(tempChar, "@@", "@") ReplaceConstChar = tempChar End Function function StrLen(Str) if Str="" or isnull(Str) then StrLen=0 exit function else dim regex set regex=new regexp regEx.Pattern ="[^\x00-\xff]" regex.Global =true Str=regEx.replace(Str,"^^") set regex=nothing StrLen=len(Str) end if end function function StrLeft(Str,StrLen) dim L,T,I,C if Str="" then StrLeft="" exit function end if Str=Replace(Replace(Replace(Replace(Str," "," "),""",Chr(34)),">",">"),"<","<") L=Len(Str) T=0 for i=1 to L C=Abs(AscW(Mid(Str,i,1))) if C>255 then T=T+2 else T=T+1 end if if T>=StrLen then StrLeft=Left(Str,i) & "…" exit for else StrLeft=Str end if next StrLeft=Replace(Replace(Replace(replace(StrLeft," "," "),Chr(34),"""),">",">"),"<","<") end function %>
