System.Collections.Specialized.NameValueCollection Members

The members of System.Collections.Specialized.NameValueCollection are listed below.

See Also: Inherited members from System.Collections.Specialized.NameObjectCollectionBase

Public Constructors

Initializes a new instance of the System.Collections.Specialized.NameValueCollection class that is empty, has the default initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.

Initializes a new instance of the System.Collections.Specialized.NameValueCollection class that is empty, has the default initial capacity, and uses the specified IEqualityComparer object.

Copies the entries from the specified System.Collections.Specialized.NameValueCollection to a new System.Collections.Specialized.NameValueCollection with the same initial capacity as the number of entries copied and using the same hash code provider and the same comparer as the source collection.

Initializes a new instance of the System.Collections.Specialized.NameValueCollection class that is empty, has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.

Initializes a new instance of the System.Collections.Specialized.NameValueCollection class that is empty, has the default initial capacity and uses the specified hash code provider and the specified comparer.

Initializes a new instance of the System.Collections.Specialized.NameValueCollection class that is empty, has the specified initial capacity, and uses the specified IEqualityComparer object.

Copies the entries from the specified System.Collections.Specialized.NameValueCollection to a new System.Collections.Specialized.NameValueCollection with the specified initial capacity or the same initial capacity as the number of entries copied, whichever is greater, and using the default case-insensitive hash code provider and the default case-insensitive comparer.

Initializes a new instance of the System.Collections.Specialized.NameValueCollection class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.

Protected Constructors

Public Properties

[read-only]
AllKeysstring[].

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

[read-only]
Countint. Gets the number of elements contained in the current instance.
[read-only]
default property
Item(int)string. Gets the value in the current instance that is associated with the specified index.
default property
Item(string)string. Gets or sets the value in the current instance that is associated with the specified key.

Protected Properties

IsReadOnlybool. Gets or sets a value indicating whether the current instance is read-only.

Public Methods

Add(NameValueCollection)

Copies the entries in the specified System.Collections.Specialized.NameValueCollection to the current System.Collections.Specialized.NameValueCollection.

Add(string, string)

Adds an entry with the specified name and value to the System.Collections.Specialized.NameValueCollection.

Clear()

Invalidates the cached arrays and removes all entries from the System.Collections.Specialized.NameValueCollection.

CopyTo(Array, int)

Copies the entire System.Collections.Specialized.NameValueCollection to a compatible one-dimensional Array, starting at the specified index of the target array.

Get(int) : string

Gets the values at the specified index of the System.Collections.Specialized.NameValueCollection combined into one comma-separated list.

Get(string) : string

Gets the values associated with the specified key from the System.Collections.Specialized.NameValueCollection combined into one comma-separated list.

GetKey(int) : string

Gets the key at the specified index of the System.Collections.Specialized.NameValueCollection.

GetValues(int) : string[]

Gets the values at the specified index of the System.Collections.Specialized.NameValueCollection.

GetValues(string) : string[]

Gets the values associated with the specified key from the System.Collections.Specialized.NameValueCollection.

HasKeys() : bool

Gets a value indicating whether the System.Collections.Specialized.NameValueCollection contains keys that are not null.

Remove(string)

Removes the entries with the specified key from the System.Collections.Specialized.NameObjectCollectionBase instance.

Set(string, string)

Sets the value of an entry in the System.Collections.Specialized.NameValueCollection.

Protected Methods

InvalidateCachedArrays()

Resets the cached arrays of the collection to null.