HttpApplicationState.GetKey(Int32) HttpApplicationState.GetKey(Int32) HttpApplicationState.GetKey(Int32) HttpApplicationState.GetKey(Int32) Method

定義

インデックスを使って HttpApplicationState オブジェクト名を取得します。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

パラメーター

index
Int32 Int32 Int32 Int32

アプリケーション状態オブジェクトのインデックス。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 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

適用対象