System.Web Namespace HttpApplicationState Class
Gets an HttpApplicationState object name by index.
[ VB ]
Public Function GetKey ( _
ByVal index As Integer _
) As String
[ C# ]
public string GetKey (
int index
);
[ C++ ]
public: String* GetKey (
int index
);
[ JScript ]
public function GetKey (
index : int
) : String;
- index
- The index of the application state object.
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.
int i;
String [ ] stateVars = new String [ Application.Count ];
for ( i = 0; i < Application.Count; i++ ) {
stateVars [ i ] = Application.GetKey ( i );
}
Dim i As Integer
Dim stateVars ( Application.Count ) As String
For i = 0 To Application.Count -1
stateVars ( i ) = Application.GetKey ( i )
Next i
var i : int
var stateVars : String [ ] = new String [ Application.Count ]
for ( i = 0; i < Application.Count; i++ ) {
stateVars ( i ) = Application.GetKey ( i );
} |
|
C# |
VB |
JScript |
HttpApplicationState Members