This documentation is archived and is not being maintained.

Hashtable.Keys Property

Gets an ICollection containing the keys in the Hashtable.

[Visual Basic]
Public Overridable ReadOnly Property Keys As ICollection  _
   Implements IDictionary.Keys
public virtual ICollection Keys {get;}
public: __property virtual ICollection* get_Keys();
public function get Keys() : ICollection;

Property Value

An ICollection containing the keys in the Hashtable.




The order of the keys in the ICollection is unspecified, but it is the same order as the associated values in the ICollection returned by the Values method.

The returned ICollection is not a static copy; instead, the ICollection refers back to the keys in the original Hashtable. Therefore, changes to the Hashtable continue to be reflected in the ICollection.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Hashtable Class | Hashtable Members | System.Collections Namespace | ICollection | Values