Server Cache part function started
Public Property Let Name (ByVal vnewvalue)
Localcachename = LCase (vnewvalue)
Cache_data = Application (CacheName & "_" & Localcachename)
End Property
Public Property Let Value (ByVal vnewvalue)
If localcachename <> "" Then
ReDim Cache_data (2)
Cache_data (0) = Vnewvalue
Cache_data (1) = Now ()
Application.Lock
Application (CacheName & "_" & localcachename) = Cache_data
Application.UnLock
Else
Err.Raise vbObjectError + 1, "Newaspcacheserver", "Please change the cachename."
End If
End Property
Public Property Get Value ()
If localcachename <> "" Then
If IsArray (cache_data) Then
Value = Cache_data (0)
Else
' Err.Raise vbObjectError + 1, "Newaspcacheserver", "The Cache_data (" &LocalCacheName& ") is Empty."
End If
Else
Err.Raise vbObjectError + 1, "Newaspcacheserver", "Please change the cachename."
End If
End Property
Public Function Objisempty ()
Objisempty = True
If not IsArray (cache_data) Then Exit Function
If not IsDate (Cache_data (1)) Then Exit Function
If DateDiff ("s", CDate (Cache_data (1)), now ()) < (* reloadtime) Then objisempty = False
End Function
Public Sub Delcahe (mycahename)
Application.Lock
Application.Contents.Remove (CacheName & "_" & Mycahename)
Application.UnLock
End Sub
Public Sub Delcache (mycahename)
Application.Lock
Application.Contents.Remove ("Mynewasp_" & Mycahename)
Application.UnLock
End Sub