HttpSessionState.Contents 属性

定义

获取对当前会话状态对象的引用。

public:
 property System::Web::SessionState::HttpSessionState ^ Contents { System::Web::SessionState::HttpSessionState ^ get(); };
public System.Web.SessionState.HttpSessionState Contents { get; }
member this.Contents : System.Web.SessionState.HttpSessionState
Public ReadOnly Property Contents As HttpSessionState

属性值

HttpSessionState

当前的 HttpSessionState

示例

下面的代码示例列出了属性中的 Contents 项名称和值。

foreach (string s in Session.Contents)
  Response.Write(s + " = " + Session[s].ToString() + "<br />");
For Each s As String In Session.Contents
  Response.Write(String.Format("{0} = {1}<br />", s, Session(s)))
Next

注解

提供此属性 Contents 是为了与早期版本的 ASP 兼容。

适用于

另请参阅