HttpApplicationState.GetKey(Int32) Method

Definition

Gets an HttpApplicationState object name by index.

C#
public string GetKey(int index);

Parameters

index
Int32

The index of the application state object.

Returns

The name under which the application state object was saved.

Examples

The following example returns the names of all the objects in the application state collection and stores the names in a string array.

C#
int Loop1;
String[] StateVars = new String[Application.Count];

for (Loop1 = 0; Loop1 < Application.Count; Loop1++)
{
   StateVars[Loop1] = Application.GetKey(Loop1);
}

Applies to

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