ISessionStateItemCollection.Keys 属性

定义

为存储在集合中的所有值获取变量名的集合。

public:
 property System::Collections::Specialized::NameObjectCollectionBase::KeysCollection ^ Keys { System::Collections::Specialized::NameObjectCollectionBase::KeysCollection ^ get(); };
public System.Collections.Specialized.NameObjectCollectionBase.KeysCollection Keys { get; }
member this.Keys : System.Collections.Specialized.NameObjectCollectionBase.KeysCollection
Public ReadOnly Property Keys As NameObjectCollectionBase.KeysCollection

属性值

包含所有集合键的 NameObjectCollectionBase.KeysCollection

示例

下面的代码示例演示属性的 Keys 实现,该属性使用 SortedList 来存储会话变量名称和值。 有关接口的完整实现 ISessionStateItemCollection 的示例,请参阅接口概述中 ISessionStateItemCollection 提供的示例。

public NameObjectCollectionBase.KeysCollection Keys
{
  get { return (NameObjectCollectionBase.KeysCollection)pItems.Keys; }
}
Public ReadOnly Property Keys As NameObjectCollectionBase.KeysCollection _
  Implements ISessionStateItemCollection.Keys
  Get
    Return CType(pItems.Keys, NameObjectCollectionBase.KeysCollection)
  End Get
End Property

适用于

另请参阅