Delegate.GetHashCode 方法

定义

返回委托的哈希代码。Returns a hash code for the delegate.

public:
 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer

返回

委托的哈希代码。A hash code for the delegate.

注解

由于两个原因,此方法的返回值不能持久保存。The return value of this method must not be persisted for two reasons. 首先,可能会改变类的哈希函数,以生成更好的分布,从而使旧哈希函数中的所有值都无用。First, the hash function of a class might be altered to generate a better distribution, rendering any values from the old hash function useless. 其次,此类的默认实现不保证不同的实例将返回相同的值。Second, the default implementation of this class does not guarantee that the same value will be returned by different instances.

安全性

ReflectionPermission
当通过诸如InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])等机制后期绑定调用时。when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). 关联的枚举:MemberAccessAssociated enumeration: MemberAccess

适用于

另请参阅