HttpApplicationState.GetKey-Methode
Ruft einen HttpApplicationState-Objektnamen anhand des Indexes ab.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Syntax
'Declaration
Public Function GetKey ( _
index As Integer _
) As String
'Usage
Dim instance As HttpApplicationState
Dim index As Integer
Dim returnValue As String
returnValue = instance.GetKey(index)
public string GetKey (
int index
)
public:
String^ GetKey (
int index
)
public String GetKey (
int index
)
public function GetKey (
index : int
) : String
Parameter
- index
Der Index des Anwendungszustandsobjekts.
Rückgabewert
Der Name, unter dem das Anwendungszustandsobjekt gespeichert wurde.
Beispiel
Im folgenden Beispiel werden die Namen aller Objekte in der Anwendungszustandsauflistung zurückgegeben und in einem Zeichenfolgenarray gespeichert.
Dim Loop1 As Integer
Dim StateVars(Application.Count) As String
For Loop1 = 0 To Application.Count -1
StateVars(Loop1) = Application.GetKey(Loop1)
Next Loop1
int Loop1;
String[] StateVars = new String[Application.Count];
for (Loop1 = 0; Loop1 < Application.Count; Loop1++)
{
StateVars[Loop1] = Application.GetKey(Loop1);
}
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)
Plattformen
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
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
HttpApplicationState-Klasse
HttpApplicationState-Member
System.Web-Namespace