NameValueCollection.AllKeys Property

Definition

取得 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; }
member this.AllKeys : string[]
Public Overridable ReadOnly Property AllKeys As String()

Property Value

String[]

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

Remarks

如果集合是空的,這個方法會傳回空的 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.

Applies to

See also