Partager via


IDictionary.Add Method

Adds an element with the provided key and value to the IDictionary object.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)

Syntax

public void Add (
         Object key,
         Object value
)

Parameters

  • key
    The Object to use as the key of the element to add.
  • value
    The Object to use as the value of the element to add.

Remarks

The exact position in the dictionary is implementation-dependent.

A hashtable will always hash the same key to the same position. This position may be different if a different hash function is used.

Version Information

Available in the .NET Micro Framework version 4.1 and 4.2.

See Also

Reference

IDictionary Interface
IDictionary Members
System.Collections Namespace