cls_main.asp第1/3页

时间:2021-05-28

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

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


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
Err.RaisevbObjectError+1,"Mesky.CnCacheServer","pleasechangetheCacheName."
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
Name=Rs(i).Name
'Response.Write(Rs(i).Name)
Value=Rs(i).Value
Next
EndIf
SetRs=Nothing
EndSub
123下一页阅读全文

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章