HttpSessionState.Contents 屬性

定義

取得目前工作階段物件的參考。

public System.Web.SessionState.HttpSessionState Contents { get; }

屬性值

目前的 HttpSessionState

範例

下列程式代碼範例會列出 屬性中的 Contents 專案名稱和值。

foreach (string s in Session.Contents)
  Response.Write(s + " = " + Session[s].ToString() + "<br />");

備註

提供 Contents 屬性以便與舊版 ASP 相容。

適用於

產品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

另請參閱