걱똑왕쇌 뻠닸잚

2018-09-06 13:16

阅读:524

  걱똑왕쇌뻠닸잚덜쯤
릿齡덜쯤 덜쯤흔苟:
<%
classCache
privateobjcache코휭
privateexpireTime법퍅珂쇌
privateexpireTimeName법퍅珂쇌application츰
privatecacheNamecache코휭application츰
privatepathurl

privatesubclass_initialize()
path=request.servervariables(url)
path=left(path,instrRev(path,/))
endsub

privatesubclass_terminate()
endsub

publicpropertygetblEmpty
角뤠槨왕
ifisempty(obj)then
blEmpty=true
else
blEmpty=false
endif
endproperty

publicpropertygetvalid
角뤠옵痰(법퍅)
ifisempty(obj)ornotisDate(expireTime)then
valid=false
elseifCDate(expireTime)<nowthen
valid=false
else
valid=true
endif
endproperty

publicpropertyletname(str)
?阮?ache츰
cacheName=str&path
obj=application(cacheName)
expireTimeName=str&expires&path
expireTime=application(expireTimeName)
endproperty

publicpropertyletexpires(tm)
路?阮첫揮閔굴?
expireTime=tm
application.lock
application(expireTimeName)=expireTime
application.unlock
endproperty

publicsubadd(var,expire)
립令
ifisempty(var)ornotisDate(expire)then
exitsub
endif
obj=var
expireTime=expire
application.lock
application(cacheName)=obj
application(expireTimeName)=expireTime
application.unlock
endsub

publicpropertygetvalue
혤令
ifisempty(obj)ornotisDate(expireTime)then
value=null
elseifCDate(expireTime)<nowthen
value=null
else
value=obj
endif
endproperty

publicsubmakeEmpty()
姦렴application
application.lock
application(cacheName)=empty
application(expireTimeName)=empty
application.unlock
obj=empty
expireTime=empty
endsub

publicfunctionequal(var2)
궐싹
iftypename(obj)<>typename(var2)then
equal=false
elseiftypename(obj)=Objectthen
ifobjisvar2then
equal=true
else
equal=false
endif
elseiftypename(obj)=Variant()then
ifjoin(obj,^)=join(var2,^)then
equal=true
else
equal=false
endif
else
ifobj=var2then
equal=true
else
equal=false
endif
endif
endfunction
endclass
%>

賈痰렘랬:
릿齡덜쯤 덜쯤흔苟:
setmyCache=newcache
IfmyCache.validthen
StartGet=myCache.value
Else
StartGet=GetHttpPage(HttpUrl)
myCache.addStartGet,dateadd(h,3,Now)
Endif
List=GetBody(StartGet,</form>,<!--********貢女櫓꼬덜쯤써監********-->,False,False)


评论


亲,登录后才可以留言!