SessionStateItemCollection コンストラクター
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
新しい空の SessionStateItemCollection オブジェクトを作成します。
public:
SessionStateItemCollection();
public SessionStateItemCollection();
Public Sub New ()
例
次のコード例では、新しい SessionStateItemCollection オブジェクトを作成し、コレクション内の値を名前で設定および取得します。
SessionStateItemCollection items = new SessionStateItemCollection();
items["LastName"] = "Wilson";
items["FirstName"] = "Dan";
foreach (string s in items.Keys)
Response.Write("items[\"" + s + "\"] = " + items[s].ToString() + "<br />");
Dim items As SessionStateItemCollection = New SessionStateItemCollection()
items("LastName") = "Wilson"
items("FirstName") = "Dan"
For Each s As String In items.Keys
Response.Write("items(""" & s & """) = " & items(s).ToString() & "<br />")
Next
注釈
SessionStateItemCollection クラスは、変数名または数値インデックスでインデックス付けされたセッション状態変数の値を管理するために使用されます。 セッション状態変数は、現在のHttpContextまたはPageのSessionプロパティを使用してアクセスされるHttpSessionState クラスを使用して、ASP.NET アプリケーション コードに公開されます。 HttpSessionState クラスは、SessionStateItemCollection コレクションを使用してセッション状態変数の値を管理するHttpSessionStateContainer クラスを呼び出します。