cls_main.asp第1/3頁

來源:互聯網
上載者:User

<%
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 top 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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.