HttpApplicationState.Get 方法

定義

透過名稱或索引取得 HttpApplicationState 物件。

多載

名稱 Description
Get(Int32)

透過數值索引取得 HttpApplicationState 物件。

Get(String)

會以物件名稱取得 HttpApplicationState

Get(Int32)

透過數值索引取得 HttpApplicationState 物件。

public:
 System::Object ^ Get(int index);
public object Get(int index);
member this.Get : int -> obj
Public Function Get (index As Integer) As Object

參數

index
Int32

應用程式狀態物件的索引。

傳回

index所參考的物件。

範例

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

Object MyObject;
MyObject = Application.Get(0);
Dim MyObject As Object
MyObject = Application.Get(0)

適用於

Get(String)

會以物件名稱取得 HttpApplicationState

public:
 System::Object ^ Get(System::String ^ name);
public object Get(string name);
member this.Get : string -> obj
Public Function Get (name As String) As Object

參數

name
String

物件的名稱。

傳回

name所參考的物件。

備註

以下範例從Application內在物件的集合中回傳一個名為 MyAppVar1 HttpApplicationState 的物件,並將其複製到一個新的物件變數。

Dim MyObject As Object
MyObject = Application.Get("MyAppVar1")
Object MyObject;
MyObject = Application.Get("MyAppVar1");

適用於