ASP状态封装类Cache、Cookie & Session(3)
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
%>
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
%>
站长工具
相关文章

请稍等,评论加载中...