共用方式為


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

範例

下列程式代碼範例會列出 屬性中的 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 相容。

適用於

另請參閱