NameValueCollection.AllKeys 屬性

定義

取得 NameValueCollection 中的所有索引鍵。Gets all the keys in the NameValueCollection.

public:
 virtual property cli::array <System::String ^> ^ AllKeys { cli::array <System::String ^> ^ get(); };
public virtual string[] AllKeys { get; }
public virtual string[]? AllKeys { get; }
member this.AllKeys : string[]
Public Overridable ReadOnly Property AllKeys As String()

屬性值

String[]

String 陣列,包含 NameValueCollection 中的所有索引鍵。A String array that contains all the keys of the NameValueCollection.

備註

如果集合是空的,則這個方法會傳回空 String 陣列,而不是 nullIf the collection is empty, this method returns an empty String array, not null.

所傳回的陣列 AllKeys 會快取以提高效能,而且會在集合變更時自動重新整理。The arrays returned by AllKeys are cached for better performance and are automatically refreshed when the collection changes. 衍生的類別可以藉由呼叫來使快取的版本失效 InvalidateCachedArrays ,因而強制重新建立陣列。A derived class can invalidate the cached version by calling InvalidateCachedArrays, thereby forcing the arrays to be recreated.

這個方法是 O (n) 運算,其中 nCountThis method is an O(n) operation, where n is Count.

適用於

另請參閱