HttpSessionState.Contents 属性

定义

获取对当前会话状态对象的引用。Gets a reference to the current session-state object.

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

属性值

示例

下面的代码示例列出了Contents属性中的项名称和值。The following code example lists the item names and values in the Contents property.

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 的早期版本兼容。The Contents property is provided for compatibility with earlier versions of ASP.

适用于

另请参阅