HttpApplicationState.Get Method

Definition

Gets an HttpApplicationState object by name or index.

Overloads

Get(Int32)

Gets an HttpApplicationState object by numerical index.

Get(String)

Gets an HttpApplicationState object by name.

Get(Int32)

Gets an HttpApplicationState object by numerical index.

C#
public object Get(int index);

Parameters

index
Int32

The index of the application state object.

Returns

The object referenced by index.

Examples

The following example returns the first object (index = 0) from the HttpApplicationState collection of the intrinsic Application object and copies it to a new object variable.

C#
Object MyObject;
MyObject = Application.Get(0);

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Get(String)

Gets an HttpApplicationState object by name.

C#
public object Get(string name);

Parameters

name
String

The name of the object.

Returns

The object referenced by name.

Remarks

The following example returns an object named MyAppVar1 from the HttpApplicationState collection of the intrinsic Application object and copies it to a new object variable.

C#
Object MyObject;  
MyObject = Application.Get("MyAppVar1");  

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1