cls_main.asp第1/3页
网络编程 2021-07-05 10:58www.168986.cn编程入门
<%
class cls_main
Public ScriptName, SqlQueryNum, savelog, system, ResLicence, ResType, ResLanguage, UserClass, strMsg, RefererPage
Public adminName, adminPass, System_Sn, UserTrueIP
Public Reloadtime, MaxCount, CacheName, Cache_Data, sPath
Private LocalCacheName, CacheData, DelCount, ArrSetting
Public MemberUserName, MemberUserID, MemberUserPassword, MemberUserClass, MemberVipType
'类初始化
Private Sub Class_Initialize()
savelog = 0 '设置为1的时候会记录攻击或错误错信息。
SqlQueryNum = 0
Dim Tmpstr, i
Tmpstr = Request.ServerVariables("PATH_INFO")
Tmpstr = Split(Tmpstr, "/")
i = UBound(Tmpstr)
ScriptName = LCase(Tmpstr(i))
RefererPage = Request.ServerVariables("HTTP_REFERER")
adminName = Session("adminName")
adminPass = Session("adminPass")
Reloadtime = 14400
CacheName = Replace(Replace(Replace(Server.MapPath("index.asp"), "index.asp", ""), ":", ""), "\", "")
System_Sn = LCase(Replace(Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL"), Split(Request.ServerVariables("SCRIPT_NAME"), "/")(UBound(Split(Request.ServerVariables("SCRIPT_NAME"), "/"))), ""))
UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR")
UserTrueIP = checkStr(UserTrueIP)
If SystemEdition = 3 Then
sPath = "../"
Else
sPath = ""
End If
MemberUserName = checkStr(Request.Cookies(System_Sn)("MemberUserName"))
MemberUserID = checkStr(Request.Cookies(System_Sn)("MemberUserID"))
MemberUserPassword = checkStr(Request.Cookies(System_Sn)("MemberUserPassword"))
MemberUserClass = checkStr(Request.Cookies(System_Sn)("MemberUserClass"))
MemberVipType = checkStr(Request.Cookies(System_Sn)("MemberVipType"))
End Sub
'类结束
Private Sub Class_Terminate()
If IsObject(Conn) Then
'Conn.Close
Set Conn = Nothing
End If
End Sub
Public Property Let Name(ByVal vNewValue)
LocalCacheName = LCase(vNewValue)
End Property
Public Property Let Value(ByVal vNewValue)
If LocalCacheName <> "" Then
ReDim Cache_Data(2)
Cache_Data(0) = vNewValue
Cache_Data(1) = Now()
Application.Lock
Application(CacheName & "_" & LocalCacheName) = Cache_Data
Application.UnLock
Else
Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " please change the CacheName."
End If
End Property
Public Property Get Value()
If LocalCacheName <> "" Then
Cache_Data = Application(CacheName & "_" & LocalCacheName)
If IsArray(Cache_Data) Then
Value = Cache_Data(0)
Else
Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " The Cache_Data(" & LocalCacheName & ") Is Empty."
End If
Else
Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " please change the CacheName."
End If
End Property
Public Function ObjIsEmpty()
ObjIsEmpty = True
Cache_Data = Application(CacheName & "_" & LocalCacheName)
If Not IsArray(Cache_Data) Then Exit Function
If Not IsDate(Cache_Data(1)) Then Exit Function
If DateDiff("s", CDate(Cache_Data(1)), Now()) < (60 Reloadtime) Then ObjIsEmpty = False
End Function
Public Sub DelCahe(MyCaheName)
Application.Lock
Application.Contents.Remove (CacheName & "_" & MyCaheName)
Application.UnLock
End Sub
'加载系统配置信息
Public Sub LoadSetting()
Dim Rs
'If Not IsObject(Conn) Then ConnectionDatabase
Set Rs = Execute("Select Setting From Mesky_Setting where isDefault=1")
ArrSetting = Split(Rs("Setting"), "{$}")
Set Rs = Nothing
system = Split(ArrSetting(144), ",")
ResLicence = Split(ArrSetting(141), ",")
ResLanguage = Split(ArrSetting(142), ",")
ResType = Split(ArrSetting(143), ",")
UserClass = Split(ArrSetting(140), ",")
Name = "StyleName"
If ObjIsEmpty Then Call ReloadTemplates
End Sub
Public Function Setting(s)
Setting = ArrSetting(s)
End Function
Public Sub ReloadTemplates()
Dim Rs, i
Set Rs = Execute("select 1 from Mesky_Style where isDefault =1")
If Not (Rs.EOF And Rs.BOF) Then
For i = 2 To Rs.Fields.Count - 3
Name = Rs(i).Name
'Response.Write(Rs(i).Name)
Value = Rs(i).Value
Next
End If
Set Rs = Nothing
End Sub
class cls_main
Public ScriptName, SqlQueryNum, savelog, system, ResLicence, ResType, ResLanguage, UserClass, strMsg, RefererPage
Public adminName, adminPass, System_Sn, UserTrueIP
Public Reloadtime, MaxCount, CacheName, Cache_Data, sPath
Private LocalCacheName, CacheData, DelCount, ArrSetting
Public MemberUserName, MemberUserID, MemberUserPassword, MemberUserClass, MemberVipType
'类初始化
Private Sub Class_Initialize()
savelog = 0 '设置为1的时候会记录攻击或错误错信息。
SqlQueryNum = 0
Dim Tmpstr, i
Tmpstr = Request.ServerVariables("PATH_INFO")
Tmpstr = Split(Tmpstr, "/")
i = UBound(Tmpstr)
ScriptName = LCase(Tmpstr(i))
RefererPage = Request.ServerVariables("HTTP_REFERER")
adminName = Session("adminName")
adminPass = Session("adminPass")
Reloadtime = 14400
CacheName = Replace(Replace(Replace(Server.MapPath("index.asp"), "index.asp", ""), ":", ""), "\", "")
System_Sn = LCase(Replace(Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL"), Split(Request.ServerVariables("SCRIPT_NAME"), "/")(UBound(Split(Request.ServerVariables("SCRIPT_NAME"), "/"))), ""))
UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR")
UserTrueIP = checkStr(UserTrueIP)
If SystemEdition = 3 Then
sPath = "../"
Else
sPath = ""
End If
MemberUserName = checkStr(Request.Cookies(System_Sn)("MemberUserName"))
MemberUserID = checkStr(Request.Cookies(System_Sn)("MemberUserID"))
MemberUserPassword = checkStr(Request.Cookies(System_Sn)("MemberUserPassword"))
MemberUserClass = checkStr(Request.Cookies(System_Sn)("MemberUserClass"))
MemberVipType = checkStr(Request.Cookies(System_Sn)("MemberVipType"))
End Sub
'类结束
Private Sub Class_Terminate()
If IsObject(Conn) Then
'Conn.Close
Set Conn = Nothing
End If
End Sub
Public Property Let Name(ByVal vNewValue)
LocalCacheName = LCase(vNewValue)
End Property
Public Property Let Value(ByVal vNewValue)
If LocalCacheName <> "" Then
ReDim Cache_Data(2)
Cache_Data(0) = vNewValue
Cache_Data(1) = Now()
Application.Lock
Application(CacheName & "_" & LocalCacheName) = Cache_Data
Application.UnLock
Else
Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " please change the CacheName."
End If
End Property
Public Property Get Value()
If LocalCacheName <> "" Then
Cache_Data = Application(CacheName & "_" & LocalCacheName)
If IsArray(Cache_Data) Then
Value = Cache_Data(0)
Else
Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " The Cache_Data(" & LocalCacheName & ") Is Empty."
End If
Else
Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " please change the CacheName."
End If
End Property
Public Function ObjIsEmpty()
ObjIsEmpty = True
Cache_Data = Application(CacheName & "_" & LocalCacheName)
If Not IsArray(Cache_Data) Then Exit Function
If Not IsDate(Cache_Data(1)) Then Exit Function
If DateDiff("s", CDate(Cache_Data(1)), Now()) < (60 Reloadtime) Then ObjIsEmpty = False
End Function
Public Sub DelCahe(MyCaheName)
Application.Lock
Application.Contents.Remove (CacheName & "_" & MyCaheName)
Application.UnLock
End Sub
'加载系统配置信息
Public Sub LoadSetting()
Dim Rs
'If Not IsObject(Conn) Then ConnectionDatabase
Set Rs = Execute("Select Setting From Mesky_Setting where isDefault=1")
ArrSetting = Split(Rs("Setting"), "{$}")
Set Rs = Nothing
system = Split(ArrSetting(144), ",")
ResLicence = Split(ArrSetting(141), ",")
ResLanguage = Split(ArrSetting(142), ",")
ResType = Split(ArrSetting(143), ",")
UserClass = Split(ArrSetting(140), ",")
Name = "StyleName"
If ObjIsEmpty Then Call ReloadTemplates
End Sub
Public Function Setting(s)
Setting = ArrSetting(s)
End Function
Public Sub ReloadTemplates()
Dim Rs, i
Set Rs = Execute("select 1 from Mesky_Style where isDefault =1")
If Not (Rs.EOF And Rs.BOF) Then
For i = 2 To Rs.Fields.Count - 3
Name = Rs(i).Name
'Response.Write(Rs(i).Name)
Value = Rs(i).Value
Next
End If
Set Rs = Nothing
End Sub
1
上一篇:数据库记录的删除,delete好还是update好?
下一篇:MusicGet 类
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程