HttpApplicationState.GetKey(Int32) メソッド

定義

インデックスによって HttpApplicationState オブジェクト名を取得します。

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

アプリケーション状態オブジェクトのインデックス。

返品

アプリケーション状態オブジェクトが保存された名前。

次の例では、アプリケーション状態コレクション内のすべてのオブジェクトの名前を返し、その名前を文字列配列に格納します。

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

適用対象