Bearbeiten

Freigeben über


HttpApplicationState.GetKey(Int32) Method

Definition

Gets an HttpApplicationState object name by index.

public:
 System::String ^ GetKey(int index);
public string GetKey (int index);
member this.GetKey : int -> string
Public Function GetKey (index As Integer) As String

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.

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

for (Loop1 = 0; Loop1 < Application.Count; Loop1++)
{
   StateVars[Loop1] = Application.GetKey(Loop1);
}
Dim Loop1 As Integer
Dim StateVars(Application.Count) As String
 
For Loop1 = 0 To Application.Count -1
   StateVars(Loop1) = Application.GetKey(Loop1)
Next Loop1

Applies to