class NameValueCollection
in global :: System . Collections . Specialized
Represents a collection of associated keys and values that can be accessed either with the key or with the index.
public NameValueCollection( IEqualityComparer equalityComparer )
Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified object.
equalityComparerThe object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.
public NameValueCollection( IHashCodeProvider hashProvider, IComparer comparer )
Initializes a new instance of the class that is empty, has the default initial capacity and uses the specified hash code provider and the specified comparer.
hashProviderThe that will supply the hash codes for all keys in the .comparerThe to use to determine whether two keys are equal.
public NameValueCollection( NameValueCollection col )
Copies the entries from the specified to a new 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.
colThe to copy to the new instance.
public NameValueCollection( int capacity )
Initializes a new instance of the class that is empty, has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
capacityThe initial number of entries that the can contain.
public NameValueCollection( int capacity, IEqualityComparer equalityComparer )
Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified object.
capacityThe initial number of entries that the object can contain.equalityComparerThe object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection.
public NameValueCollection( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
Initializes a new instance of the class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer.
capacityThe initial number of entries that the can contain.hashProviderThe that will supply the hash codes for all keys in the .comparerThe to use to determine whether two keys are equal.
public NameValueCollection( int capacity, NameValueCollection col )
Copies the entries from the specified to a new 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.
capacityThe initial number of entries that the can contain.colThe to copy to the new instance.
public void Add( NameValueCollection c )
Copies the entries in the specified to the current .
cThe to copy to the current .
public void Add( string name, string value )
Adds an entry with the specified name and value to the .
nameThe key of the entry to add. The key can be .valueThe value of the entry to add. The value can be .
public string[] AllKeys { get; }
Gets all the keys in the .
- Returns A array that contains all the keys of the .
public void CopyTo( Array dest, int index )
Copies the entire to a compatible one-dimensional , starting at the specified index of the target array.
destThe one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.indexThe zero-based index in at which copying begins.
public string Get( int index )
Gets the values at the specified index of the combined into one comma-separated list.
indexThe zero-based index of the entry that contains the values to get from the collection.- Returns A that contains a comma-separated list of the values at the specified index of the , if found; otherwise, .
public string Get( string name )
Gets the values associated with the specified key from the combined into one comma-separated list.
nameThe key of the entry that contains the values to get. The key can be .- Returns A that contains a comma-separated list of the values associated with the specified key from the , if found; otherwise, .
public string GetKey( int index )
Gets the key at the specified index of the .
indexThe zero-based index of the key to get from the collection.- Returns A that contains the key at the specified index of the , if found; otherwise, .
public string[] GetValues( int index )
Gets the values at the specified index of the .
indexThe zero-based index of the entry that contains the values to get from the collection.- Returns A array that contains the values at the specified index of the , if found; otherwise, .
public string[] GetValues( string name )
Gets the values associated with the specified key from the .
nameThe key of the entry that contains the values to get. The key can be .- Returns A array that contains the values associated with the specified key from the , if found; otherwise, .
public void Remove( string name )
Removes the entries with the specified key from the instance.
nameThe key of the entry to remove. The key can be .
public void Set( string name, string value )
Sets the value of an entry in the .
nameThe key of the entry to add the new value to. The key can be .valueThe that represents the new value to add to the specified entry. The value can be .
public void Clear( )
😔 No documentation found.
public bool HasKeys( )
😔 No documentation found.
public NameValueCollection( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public void GetObjectData( SerializationInfo info, StreamingContext context )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int Count { get; }
😔 No documentation found.
public IEnumerator GetEnumerator( )
😔 No documentation found.
public void OnDeserialization( object sender )
😔 No documentation found.
public string Item { get; }
😔 No documentation found.
public string Item { get; set; }
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public NameObjectCollectionBase.KeysCollection Keys { get; }
😔 No documentation found.