HttpApplicationState.Item[] 屬性

定義

能存取集合中的 HttpApplicationState 一個物件。 此特性被超載,允許以名稱或數值索引存取物件。

多載

名稱 Description
Item[String]

透過名稱取得單一 HttpApplicationState 物件的值。

Item[Int32]

透過索引取得單一 HttpApplicationState 物件。

Item[String]

透過名稱取得單一 HttpApplicationState 物件的值。

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

集合中物件的名稱。

屬性值

name所參考的物件。

範例

以下範例會MyAppVar1回傳一個HttpApplicationState來自該內在物件集合的物件Application,並將其複製到新的物件變數。

Object MyObject;
MyObject = Application["MyAppVar1"];
Dim MyObject As Object
MyObject = Application("MyAppVar1")

適用於

Item[Int32]

透過索引取得單一 HttpApplicationState 物件。

public:
 property System::Object ^ default[int] { System::Object ^ get(int index); };
public object this[int index] { get; }
member this.Item(int) : obj
Default Public ReadOnly Property Item(index As Integer) As Object

參數

index
Int32

集合中物件的數值索引。

屬性值

index所參考的物件。

範例

以下範例會HttpApplicationState從內在物件集合中回傳第一個物件(index = 0),Application並將其複製到新的物件變數。

Object MyObject;
MyObject = Application[0];
Dim MyObject As Object
MyObject = Application(0)

適用於