<% 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 '************************************************** '过程名:WriteErrMsg '作 用:显示错误提示信息 '参 数:无 '************************************************** Sub WriteErrMsg(sErrMsg, sComeUrl) Response.Write "错误信息" & vbCrLf Response.Write "

" & vbCrLf Response.Write "" & vbCrLf Response.Write " " & vbCrLf Response.Write " " & vbCrLf Response.Write " " & vbCrLf Response.Write "
错误信息
产生错误的可能原因:" & sErrMsg & "
" If sComeUrl <> "" Then Response.Write "<< 返回上一页" Else Response.Write "【关闭】" End If Response.Write "
" & vbCrLf Response.Write "" & vbCrLf End Sub '************************************************** '过程名:WriteSuccessMsg '作 用:显示成功提示信息 '参 数:无 '************************************************** Sub WriteSuccessMsg(sSuccessMsg, sComeUrl) Response.Write "成功信息" & vbCrLf Response.Write "

" & vbCrLf Response.Write "" & vbCrLf Response.Write " " & vbCrLf Response.Write " " & vbCrLf Response.Write " " & vbCrLf Response.Write "
恭喜你!

" & sSuccessMsg & "
" If sComeUrl <> "" Then Response.Write "<< 返回上一页" Else Response.Write "【关闭】" End If Response.Write "
" & vbCrLf Response.Write "" & vbCrLf End Sub '************************************************** '函数名:IsObjInstalled '作 用:检查组件是否已经安装 '参 数:strClassString ----组件名 '返回值:True ----已经安装 ' False ----没有安装 '************************************************** Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = CreateObject(strClassString) If Err.Number = 0 Then IsObjInstalled = True Set xTestObj = Nothing Err = 0 End Function '检查ID值 Function IsValidID(Check_ID) Dim FixID, i If IsNull(Check_ID) Or Check_ID = "" Then IsValidID = False Exit Function End If FixID = Replace(Check_ID, "|", "") FixID = Replace(FixID, ",", "") FixID = Replace(FixID, "-", "") FixID = Trim(Replace(FixID, " ", "")) If FixID = "" Or IsNull(FixID) Then IsValidID = False Else For i = 1 To Len(FixID) Step 100 If Not IsNumeric(Mid(FixID, i, 100)) Then IsValidID = False Exit Function End If Next IsValidID = True End If End Function '************************************************** '函数名:CheckBadChar '作 用:检查是否包含非法的SQL字符 '参 数:strChar-----要检查的字符 '返回值:True ----字符合法 ' False ----字符不合法 '************************************************** Function CheckBadChar(strChar) Dim strBadChar, arrBadChar, i strBadChar = "@@,+,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & ",--" arrBadChar = Split(strBadChar, ",") If strChar = "" Then CheckBadChar = False Else For i = 0 To UBound(arrBadChar) If InStr(strChar, arrBadChar(i)) > 0 Then CheckBadChar = False Exit Function End If Next End If CheckBadChar = True End Function '脚本名称,用户IP ScriptName = Trim(Request.ServerVariables("SCRIPT_NAME")) UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR") UserTrueIP = ReplaceBadChar(UserTrueIP) '选项框设定值 Public Function RadioValue(compvalue, showvalue) If compvalue = showvalue Then RadioValue = "value='" & showvalue & "' checked" Else RadioValue = "value='" & showvalue & "'" End If End Function %>