cls_main.asp第1/3页_ASP教程-查字典教程网
cls_main.asp第1/3页
cls_main.asp第1/3页
发布时间:2016-12-29 来源:查字典编辑
摘要:

<%

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

当前1/3页123下一页阅读全文

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新ASP教程学习
    热门ASP教程学习
    编程开发子分类