The key to be used to access the newly added value
value(required; any)
The new value to be added to the hashtable
Description
The Add method adds a key/value pair to the hashtable.
Usage at a Glance
key must be unique or a runtime error occurs. value does not need to be unique.
Keys are immutable. Once added, a particular key cannot be changed during the lifetime of the hashtable except by removing it through the Remove or Clear method and then adding it once again. Values associated with keys can be changed through the Item property.
The Item property can also be used to add new members to the hashtable.
To ensure that a key is unique when calling the Add method, use the ContainsKey method.