共用方式為


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 包含所有集合金鑰的部分。

範例

以下程式碼範例展示了使用 a SortedList 來儲存會話變數名稱與值的屬性實作Keys。 完整實作 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

適用於

另請參閱