cache.asp

来自「WAPmo手机网站管理平台是一款创建与管理维护WAP网站的的软件产品」· ASP 代码 · 共 48 行

ASP
48
字号
<%
'****************************************************************
'
' Library       Cache
'
'****************************************************************

Private Function GetCacheName(ByVal strName)
    Dim ret
    ret = "ASP.Cache.$1"
    ret = Replace(ret, "$1", strName)
    ret = Replace(ret, ".", "_")
    GetCacheName = ret
End Function

Public Function GetCache(ByVal strName)
    Dim strCacheName
    strCacheName = GetCacheName(strName)
    If VarType(Application.Contents(strCacheName)) = vbObject Then
        Set GetCache = Application.Contents(strCacheName)
    Else
        GetCache = Application.Contents(strCacheName)
    End If
End Function

Public Sub SetCache(ByVal strName, vtValue)
    Dim strCacheName
    strCacheName = GetCacheName(strName)
    Application.Lock
    If VarType(vtValue) = vbObject Then
        Set Application.Contents(strCacheName) = vtValue
    Else
        Application.Contents(strCacheName) = vtValue
    End If
    Application.Unlock
End Sub

Public Sub DelCache(ByVal strName)
    Application.Lock
    Application.Contents.Remove GetCacheName(strName)
    Application.Unlock
End Sub

Public Function HasCache(ByVal strName)
    HasCache = CBool(Not IsEmpty(GetCache(strName)))
End Function
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?