Mono Class Library: System.Collections.Specialized.NameValueCollection Overview | Members

System.Collections.Specialized.NameValueCollection.Set Method

Sets the value of the specified entry in the current instance to the specified value. [Edit]

public virtual void Set (string name, string value)

Parameters

name
A string containing the key of the entry to add the new value to. [Edit]
value
A string containing the new value to add to the specified entry. [Edit]

Exceptions

TypeReason
NotSupportedExceptionThe current instance is read-only. [Edit]

Remarks

Operation
If the specified key already exists in the current instance, this method overwrites the existing values with the specified value. (If the existing value contains a string of multiple comma-delimited values, the complete string is replaced with a single instance of value.) If the specified key does not exist in the current instance, this method creates a new entry using the specified key and the specified value.

Usage
Use the NameValueCollection.Add(NameValueCollection) method to add the new value to the existing list of values.

[Edit]

Requirements

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