Returns the hash code for the specified key.
[Visual Basic] Protected Overridable Function GetHash( _ ByVal key As Object _ ) As Integer [C#] protected virtual int GetHash( object key ); [C++] protected: virtual int GetHash( Object* key ); [JScript] protected function GetHash( key : Object ) : int;
The hash code for key.
| Exception Type | Condition |
|---|---|
| NullReferenceException | key is a null reference (Nothing in Visual Basic). |
If the hashtable was created with a specific IHashCodeProvider implementation, this method uses that hash code provider; otherwise, it uses the Object.GetHashCode implementation of key.
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 - Windows CE .NET, Common Language Infrastructure (CLI) Standard
Hashtable Class | Hashtable Members | System.Collections Namespace | Object.GetHashCode | Object | IHashCodeProvider