System.Collections.Specialized.NameValueCollection.AllKeys Property

Gets all the keys in the System.Collections.Specialized.NameValueCollection.

Syntax

public virtual string[] AllKeys { get; }

Value

A string array containing all the keys of the current instance. If the current instance is empty, the value of this property is an empty array.

Remarks

If the collection is empty, this method returns an empty string array, not null.

The arrays returned by NameValueCollection.AllKeys are cached for better performance and are automatically refreshed when the collection changes. A derived class can invalidate the cached version by calling NameValueCollection.InvalidateCachedArrays, thereby forcing the arrays to be recreated.

This method is an O(n) operation, where n is NameObjectCollectionBase.Count.

Requirements

Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0