Server cache Partial functions

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.