Returns the hash code for the specified key.
[Visual Basic] Overridable Protected 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 |
---|---|
ArgumentNullException | key is a null reference (in Visual Basic Nothing). |
This method can be overridden by a derived class.
If the hashtable was instantiated with a specific IHashCodeProvider implementation, this method will use that hash code provider; otherwise, it uses the GetHashCode implementation of key.
Hashtable Class | Hashtable Members | System.Collections Namespace | GetHashCode | Object | IHashCodeProvider