HttpApplicationState.GetKey(Int32) Metod

Definition

Hämtar ett HttpApplicationState objektnamn efter 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

Parametrar

index
Int32

Indexet för programtillståndsobjektet.

Returer

Namnet under vilket programtillståndsobjektet sparades.

Exempel

I följande exempel returneras namnen på alla objekt i programtillståndssamlingen och namnen lagras i en strängmatris.

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

Gäller för