cls_main.asp第13页

2018-09-06 13:21

阅读:740

  <%
classcls_main
PublicScriptName,SqlQueryNum,savelog,system,ResLicence,ResType,ResLanguage,UserClass,strMsg,RefererPage
PublicadminName,adminPass,System_Sn,UserTrueIP
PublicReloadtime,MaxCount,CacheName,Cache_Data,sPath
PrivateLocalCacheName,CacheData,DelCount,ArrSetting
PublicMemberUserName,MemberUserID,MemberUserPassword,MemberUserClass,MemberVipType
类初始化
PrivateSubClass_Initialize()
savelog=0设置为1的时候会记录攻击或错误错信息。
SqlQueryNum=0
DimTmpstr,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)
IfUserTrueIP=ThenUserTrueIP=Request.ServerVariables(REMOTE_ADDR)
UserTrueIP=checkStr(UserTrueIP)

IfSystemEdition=3Then
sPath=../
Else
sPath=
EndIf

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))


EndSub

类结束
PrivateSubClass_Terminate()
IfIsObject(Conn)Then
Conn.Close
SetConn=Nothing
EndIf
EndSub

PublicPropertyLetName(ByValvNewValue)
LocalCacheName=LCase(vNewValue)
EndProperty
PublicPropertyLetValue(ByValvNewValue)
IfLocalCacheName<>Then
ReDimCache_Data(2)
Cache_Data(0)=vNewValue
Cache_Data(1)=Now()
Application.Lock
Application(CacheName&_&LocalCacheName)=Cache_Data
Application.UnLock
Else
EndIf
EndProperty
PublicPropertyGetValue()
IfLocalCacheName<>Then
Cache_Data=Application(CacheName&_&LocalCacheName)
IfIsArray(Cache_Data)Then
Value=Cache_Data(0)
Else
Err.RaisevbObjectError+1,Mesky.CnCacheServer,TheCache_Data(&LocalCacheName&)IsEmpty.
EndIf
Else
Err.RaisevbObjectError+1,Mesky.CnCacheServer,pleasechangetheCacheName.
EndIf
EndProperty
PublicFunctionObjIsEmpty()
ObjIsEmpty=True
Cache_Data=Application(CacheName&_&LocalCacheName)
IfNotIsArray(Cache_Data)ThenExitFunction
IfNotIsDate(Cache_Data(1))ThenExitFunction
IfDateDiff(s,CDate(Cache_Data(1)),Now())<(60*Reloadtime)ThenObjIsEmpty=False
EndFunction
PublicSubDelCahe(MyCaheName)
Application.Lock
Application.Contents.Remove(CacheName&_&MyCaheName)
Application.UnLock
EndSub

加载系统配置信息
PublicSubLoadSetting()
DimRs
IfNotIsObject(Conn)ThenConnectionDatabase
SetRs=Execute(SelectSettingFromMesky_SettingwhereisDefault=1)
ArrSetting=Split(Rs(Setting),{$})
SetRs=Nothing
system=Split(ArrSetting(144),,)
ResLicence=Split(ArrSetting(141),,)
ResLanguage=Split(ArrSetting(142),,)
ResType=Split(ArrSetting(143),,)
UserClass=Split(ArrSetting(140),,)
Name=StyleName
IfObjIsEmptyThenCallReloadTemplates
EndSub
PublicFunctionSetting(s)
Setting=ArrSetting(s)
EndFunction
PublicSubReloadTemplates()
DimRs,i
SetRs=Execute(selecttop1*fromMesky_StylewhereisDefault=1)
IfNot(Rs.EOFAndRs.BOF)Then
Fori=2ToRs.Fields.Count-3
Response.Write(Rs(i).Name)
Value=Rs(i).Value
Next
EndIf
SetRs=Nothing
EndSub
123下一页阅读全文


评论


亲,登录后才可以留言!