function GetCache, the desired cache is automatically created.
Copy Code code as follows:
Function GetCache (Funsname,isreset,isarr,timeinfo)
' funsname-need to cache the content, here to enter a function name
' isreset– Update [value: 0 (Automatic update based on time or judgment cache is empty), 1 (active update)]
' isarr--The cached content is a data [0 is a string, 1 is an array]
' timeinfo--cache update time, in seconds, when the value is 0 o'clock, update only if the cache is empty
Dim domain = "cnzhaopin.com.cn"
Dim Temp_getconfig
Dim Re_getcache:re_getcache = False
Dim Temp_isarray_type:temp_isarray_type = False
Dim appfunsname:appfunsname = replace (replace (Funsname, (","), ")", "" ",", ",". ")
If Isarr = 1 Then temp_isarray_type = True
If isreset = 1 Then re_getcache = True
If Isreset = 2 Then
Execute ("temp_getconfig=" &funsname)
GetCache = Temp_getconfig
Exit Function
End If
IF Application (domain& "_" &Appfunsname& "_time") = "" and timeinfo<>0 Then Re_getcache = True
If not Re_getcache Then
If Temp_isarray_type Then
If not IsArray (Application (domain& "_" &appfunsname)) Then Re_getcache = True
Else
IF Application (domain& "_" &appfunsname) = "" Then Re_getcache = True
End If
End If
If not Re_getcache and timeinfo<>0 Then
If Int (DateDiff ("s", Application (domain& "_" &Appfunsname& "_time"), Now ()) >timeinfo Then = True
End If
If Re_getcache Then
Execute ("temp_getconfig=" &funsname)
Application.Lock
Application (domain& "_" &appfunsname) = Temp_getconfig
Application (domain& "_" &Appfunsname& "_time") = Now ()
Application.UnLock
Else
Temp_getconfig=application (domain& "_" &appfunsname)
End If
GetCache = Temp_getconfig
End Function
When used:
Copy Code code as follows:
Function OUTPUT3
Output3= ""
Set Newrs=conn.execute ("select" Companyname,comid,vipdata,ishot from the company where Isok=1 and Vipqx>60 and vipqx& Lt;300 and Vip=1 and Comid in (select Comid from jobs where zt<>1) Order by NEWID ())
Do as not newrs.eof
Output3=output3 & ".... ..."
Newrs.movenext
Loop
Newrs.close
Set newrs=nothing
End Function
Response.Write GetCache ("output3″,0,0,3600")