网络编程
位置:首页>> 网络编程>> Asp编程>> ASP状态封装类Cache、Cookie & Session(3)

ASP状态封装类Cache、Cookie & Session(3)

作者:Movoin 来源:Movoin ^ Blog 发布时间:2008-05-11 19:33:00 

标签:缓存,cache,cookie,session,asp

SessionState类,建议实例化时用名Session

程序代码

<%
Class SessionState

Public Default Property Get Contents(ByVal Key)
Contents = Session(Key)
End Property

Public Property Let TimeOut(ByVal value)
Session.TimeOut = value
End Property

Public Property Get TimeOut()
TimeOut = Session.TimeOut
End Property

Public Sub Add(ByVal Key, ByVal value)
Session(Key) = value
End Sub

Public Sub Remove(ByVal Key)
Session.Contents.Remove(Key)
End Sub

Public Function values(ByVal Key)
values = Session(Key)
End Function

Public Sub Clear()
Session.Abandon()
End Sub

Public Sub RemoveAll()
Clear()
End Sub

Private Sub Class_initialize()
End Sub
Private Sub Class_Terminate()
End Sub

End Class
%>
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com