HttpSessionState.Item[] 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定個別會話的值。
多載
| 名稱 | Description |
|---|---|
| Item[Int32] |
透過數值索引取得或設定會話值。 |
| Item[String] |
透過名稱取得或設定會話值。 |
Item[Int32]
透過數值索引取得或設定會話值。
public:
property System::Object ^ default[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
public object this[int index] { get; set; }
member this.Item(int) : obj with get, set
Default Public Property Item(index As Integer) As Object
參數
- index
- Int32
會話值的數值索引。
屬性值
儲存在指定索引的會話狀態值,或 null 是該項目不存在時的值。
另請參閱
適用於
Item[String]
透過名稱取得或設定會話值。
public:
property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ name); void set(System::String ^ name, System::Object ^ value); };
public object this[string name] { get; set; }
member this.Item(string) : obj with get, set
Default Public Property Item(name As String) As Object
參數
- name
- String
會話值的鍵名稱。
屬性值
使用指定名稱的 session-state 值,或 null 是該項目不存在時。