Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2004, 12:39 AM
Authorized User
 
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ³Â×÷
Default ¿´¿´Õâ¸öÊÇÔõô¹¤×÷µÄ£¿

<%
'ÂÛ̳Ö÷»º´æÊý¾Ý
Dim Dv_Cache
Set Dv_Cache=New Cls_Cache
'Set Dv_Cache=Server.CreateObject("webserver.Cls_cache" )
Dv_Cache.Reloadtime=14400
Dv_Cache.CacheName="Dvbbs"
'Ò³ÃæÁÙʱÊý¾Ý
Dim Page_Cache
Set Page_Cache=New Cls_Cache
Page_Cache.Reloadtime=0.5
Page_Cache.CacheName="pages"
Dim templates_Cache
Set templates_Cache=New Cls_Cache
templates_Cache.CacheName="templates"
Class Cls_Cache
    Rem ==================ʹÓÃ˵Ã÷================ ================================================== ===============
    Rem = ±¾ÀàÄ£¿éÊǶ¯ÍøÏÈ·æÔ­´´£¬× ÷ÕߣºÃÔ³ÇÀË×Ó¡£Èç²ÉÓñ¾Àà Ä£¿é£¬Ç벻ҪȥµôÕâ¸ö˵Ã÷¡ £Õâ¶Î×¢ÊͲ»»áÓ°ÏìÖ´ÐеÄËÙ ¶È¡£=
    Rem = ×÷Ó㺻º´æºÍ»º´æ¹ÜÀíÀà =
    Rem = ¹«ÓбäÁ¿£ºReloadtime ¹ýÆÚʱ¼ä£¨µ¥Î»Îª·ÖÖÓ£©È±Ê ¡ÖµÎª14400, =
    Rem = MaxCount »º´æ¶ÔÏóµÄ×î´óÖµ£¬³¬¹ýÔò× Ô¶¯É¾³ýʹÓôÎÊýÉٵĶÔÏó¡£ ȱʡֵΪ300 =
    Rem = CacheName »º´æ×éµÄ×ÜÃû³Æ£¬È±Ê¡ÖµÎª"D vbbs",Èç¹ûÒ»¸öÕ¾µãÖÐÓг¬¹ýÒ» ¸ö»º´æ×飬ÔòÐèÒªÍⲿ¸Ä±äÕ â¸öÖµ¡£ =
    Rem = ÊôÐÔ:Name ¶¨Ò建´æ¶ÔÏóÃû³Æ£¬Ö»Ð´ÊôÐ Ô¡£ =
    Rem = ÊôÐÔ:value ¶ÁÈ¡ºÍдÈ뻺´æÊý¾Ý¡£ =
    Rem = º¯Êý£ºObjIsEmpty()Åжϵ±Ç°»º´æÊ Ç·ñ¹ýÆÚ¡£ =
    Rem = ·½·¨£ºDelCahe(MyCaheName)ÊÖ¹¤É¾³ýÒ »Â¸Ã¶Â»ÂºÂ´Ã¦Â¶Ã”Ï󣬲ÎÊýÊÇ»º´æ¶Ôà Ã³ÂµÃ„Ãû³Æ¡£ =
    Rem ================================================== ================================================== =======
    Public Reloadtime,MaxCount,CacheName
    Private LocalCacheName,CacheData,DelCount
    Private Sub Class_Initialize()
        Reloadtime=14400
        CacheName="Dvbbs"
    End Sub
    Private Sub SetCache(SetName,NewValue)
        Application.Lock
        Application(SetName) = NewValue
        Application.unLock
    End Sub
    Private Sub makeEmpty(SetName)
        Application.Lock
        Application(SetName) = Empty
        Application.unLock
    End Sub
    Public Property Let Name(ByVal vNewValue)
        LocalCacheName=LCase(vNewValue)
    End Property
    Public Property Let Value(ByVal vNewValue)
        If LocalCacheName<>"" Then
            CacheData=Application(CacheName&"_"&LocalCacheName )
            If IsArray(CacheData) Then
                CacheData(0)=vNewValue
                CacheData(1)=Now()
            Else
                ReDim CacheData(2)
                CacheData(0)=vNewValue
                CacheData(1)=Now()
            End If
            SetCache CacheName&"_"&LocalCacheName,CacheData
        Else
            Err.Raise vbObjectError + 1, "DvbbsCacheServer", " please change the CacheName."
        End If
    End Property
    Public Property Get Value()
        If LocalCacheName<>"" Then
            CacheData=Application(CacheName&"_"&LocalCacheName )
            If IsArray(CacheData) Then
                Value=CacheData(0)
            Else
                Err.Raise vbObjectError + 1, "DvbbsCacheServer", " The CacheData Is Empty."
            End If
        Else
            Err.Raise vbObjectError + 1, "DvbbsCacheServer", " please change the CacheName."
        End If
    End Property
    Public Function ObjIsEmpty()
        ObjIsEmpty=True
        CacheData=Application(CacheName&"_"&LocalCacheName )
        If Not IsArray(CacheData) Then Exit Function
        If Not IsDate(CacheData(1)) Then Exit Function
        If DateDiff("s",CDate(CacheData(1)),Now()) < 60*Reloadtime Then
            ObjIsEmpty=False
        End If
    End Function
    Public Sub DelCahe(MyCaheName)
        makeEmpty(CacheName&"_"&MyCaheName)
    End Sub
End Class
%>


help me?

 
Old April 22nd, 2004, 11:21 AM
Authorized User
 
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ³Â×÷
Default

no person understand£¿
ûÓÐÈËÖªµÀÂð£¿










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.