HttpSessionState.Item[] 屬性

定義

取得或設定個別的工作階段值。Gets or sets individual session values.

多載

Item[Int32]

根據數值索引取得或設定工作階段值。Gets or sets a session value by numerical index.

Item[String]

根據名稱取得或設定工作階段值。Gets or sets a session value by name.

Item[Int32]

根據數值索引取得或設定工作階段值。Gets or sets a session value by numerical index.

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

工作階段值的數值索引。The numerical index of the session value.

屬性值

Object

指定索引處儲存的工作階段狀態值,如果項目不存在則為 nullThe session-state value stored at the specified index, or null if the item does not exist.

適用於

Item[String]

根據名稱取得或設定工作階段值。Gets or sets a session value by name.

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

工作階段值的索引鍵名稱。The key name of the session value.

屬性值

Object

具有指定名稱的工作階段狀態值,如果項目不存在則為 nullThe session-state value with the specified name, or null if the item does not exist.

適用於