企业网站建设毕业论文(致谢+开题报告+中期报告+源程序) 第7页
4.2、系统业务逻辑处理公共文件核心代码:
<%
'定义数据库连接的语句
dim db
dim Connstr
dim Conn
dim fout
Dim VbStr
VbStr = Chr(13) & Chr(10)
Sub DBConnBegin()
db="/qmsz/yyy/basedata/#szqm.mdb"
'Connstr="Driver={Microsoft Access Driver (*.mdb)};uid=admin;pwd=200000;dbq=" & Server.MapPath(db)
Connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)&";Jet Oledb:Database Password=Atllh1987"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open connstr
If Err.Number > 0 Then
response.write("数据库连接出错,请仔细检查您的数据库连接文件")
Response.End
End If
dim timeoutsession
timeoutsession=20
session.timeout=timeoutsession
End Sub
Sub DBConnEnd()
Conn.Close
Set Conn = Nothing
End Sub
' ============================================
' 把字符串进行HTML解码,替换server.htmlencode
' 去除Html格式,用于显示输出
' ============================================
Function outHTML(str)
Dim sTemp
sTemp = str
outHTML = ""
If IsNull(sTemp) = True Then
Exit Function
End If
sTemp = Replace(sTemp, "&", "&")
sTemp = Replace(sTemp, "<", "<")
sTemp = Replace(sTemp, ">", ">")
sTemp = Replace(sTemp, Chr(34), """)
sTemp = Replace(sTemp, Chr(10), "<br>")
outHTML = sTemp
End Function
Function inHTML(str)
Dim sTemp
sTemp = str
inHTML = ""
If IsNull(sTemp) = True Then
Exit Function
End If
sTemp = Replace(sTemp, "&", "&")
sTemp = Replace(sTemp, "<", "<")
sTemp = Replace(sTemp, ">", ">")
sTemp = Replace(sTemp, Chr(34), """)
inHTML = sTemp
End Function
Function IsSelfRefer()
Dim sHttp_Referer, sServer_Name
sHttp_Referer = CStr(Request.ServerVariables("HTTP_REFERER"))
sServer_Name = CStr(Request.ServerVariables("SERVER_NAME"))
If Mid(sHttp_Referer, 8, Len(sServer_Name)) = sServer_Name Then
IsSelfRefer = True
Else
IsSelfRefer = False
End If
End Function
Function Get_SafeStr(str)
Get_SafeStr = Replace(Replace(Replace(Trim(str), "'", ""), Chr(34), ""), ";", "")
End Function
www.751com.cn For i = 1 To l
c = Asc(Mid(str, i, 1))
If c < 0 Then c = c + 65536
If c > 255 Then t = t + 1
Next
Get_TrueLen = t
End Function
' ============================================
' 判断是否安全字符串,在注册登录等特殊字段中使用
' ============================================
Function IsSafeStr(str)
Dim s_BadStr, n, i
s_BadStr = "' &<>?%,;:()`~!@#$^*{}[]|+-=" & Chr(34) & Chr(9) & Chr(32)
n = Len(s_BadStr)
IsSafeStr = True
For i = 1 To n
If Instr(str, Mid(s_BadStr, i, 1)) > 0 Then
IsSafeStr = False
Exit Function End If Next
End Function
'==============================================
'一个加密的函数
'==============================================
Function EnPas(CodeStr)
Dim CodeLen,CodeSpace,NewCode,cecr,cecb,cec
CodeLen = 30
CodeSpace = CodeLen - Len(CodeStr)
If Not CodeSpace < 1 Then
For cecr = 1 To CodeSpace
CodeStr = CodeStr & Chr(21)
Next End If
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页
企业网站建设毕业论文(致谢+开题报告+中期报告+源程序) 第7页下载如图片无法显示或论文不完整,请联系qq752018766