HttpApplicationState.GetKey(Int32) Méthode

Définition

Obtient un nom d'objet HttpApplicationState par son 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

Paramètres

index
Int32

Index de l'objet d'état de l'application.

Retours

Nom sous lequel l'objet d'état de l'application a été enregistré.

Exemples

L’exemple suivant retourne les noms de tous les objets de la collection d’états d’application et stocke les noms dans un tableau de chaînes.

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

S’applique à