HttpApplicationState.GetKey(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
通过索引获取 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