123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <%
- 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 "<html><head><title>错误信息</title><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
- Response.Write "<link href='bs2010.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbCrLf
- Response.Write "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border' align=center>" & vbCrLf
- Response.Write " <tr align='center' class='title'><td height='22'><strong>错误信息</strong></td></tr>" & vbCrLf
- Response.Write " <tr class='tdbg'><td height='100' valign='top'><b>产生错误的可能原因:</b>" & sErrMsg & "</td></tr>" & vbCrLf
- Response.Write " <tr align='center' class='tdbg'><td>"
- If sComeUrl <> "" Then
- Response.Write "<a href='javascript:history.go(-1)'><< 返回上一页</a>"
- Else
- Response.Write "<a href='javascript:window.close();'>【关闭】</a>"
- End If
- Response.Write "</td></tr>" & vbCrLf
- Response.Write "</table>" & vbCrLf
- Response.Write "</body></html>" & vbCrLf
- End Sub
- '**************************************************
- '过程名:WriteSuccessMsg
- '作 用:显示成功提示信息
- '参 数:无
- '**************************************************
- Sub WriteSuccessMsg(sSuccessMsg, sComeUrl)
- Response.Write "<html><head><title>成功信息</title><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
- Response.Write "<link href='" & strInstallDir & "images/Style.css' rel='stylesheet' type='text/css'></head><body><br><br>" & vbCrLf
- Response.Write "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border' align=center>" & vbCrLf
- Response.Write " <tr align='center' class='title'><td height='22'><strong>恭喜你!</strong></td></tr>" & vbCrLf
- Response.Write " <tr class='tdbg'><td height='100' valign='top'><br>" & sSuccessMsg & "</td></tr>" & vbCrLf
- Response.Write " <tr align='center' class='tdbg'><td>"
- If sComeUrl <> "" Then
- Response.Write "<a href='" & sComeUrl & "'><< 返回上一页</a>"
- Else
- Response.Write "<a href='javascript:window.close();'>【关闭】</a>"
- End If
- Response.Write "</td></tr>" & vbCrLf
- Response.Write "</table>" & vbCrLf
- Response.Write "</body></html>" & 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
- %>
|