HttpApplicationState.GetKey Method

Gets an HttpApplicationState object name by index.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public:
String^ GetKey (
	int index
)
public String GetKey (
	int index
)
public function GetKey (
	index : int
) : String

Parameters

index

The index of the application state object.

Return Value

The name under which the application state object was saved.

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

No code example is currently available or this language may not be supported.
int loop1;
String stateVars[] = new String[get_Application().get_Count()];
for (loop1 = 0; loop1 < get_Application().get_Count(); loop1++) {
    stateVars.set_Item(loop1, get_Application().GetKey(loop1));
}

var loop1 : int
var stateVars : String[] = new String[Application.Count]

for(loop1 = 0; loop1 < Application.Count; loop1++)
  stateVars(loop1) = Application.GetKey(loop1)

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show: