PolicyStatement.GetHashCode 方法
定义
获取 PolicyStatement 对象的哈希代码,此代码适合在哈希算法和数据结构(例如哈希表)中使用。Gets a hash code for the PolicyStatement object that is suitable for use in hashing algorithms and data structures such as a hash table.
public:
override int GetHashCode();
public override int GetHashCode ();
[System.Runtime.InteropServices.ComVisible(false)]
public override int GetHashCode ();
override this.GetHashCode : unit -> int
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer
返回
当前 PolicyStatement 对象的哈希代码。A hash code for the current PolicyStatement object.
- 属性
示例
下面的代码示例演示如何使用 GetHashCode 方法获取当前策略语句的哈希代码。The following code example shows how to use the GetHashCode method to get the hash code for the current policy statement. 此代码示例是为类提供的更大示例的一部分 PolicyStatement 。This code example is part of a larger example provided for the PolicyStatement class.
int hashCode = policyStatement->GetHashCode();
int hashCode = policyStatement.GetHashCode();
Dim hashCode As Integer = policyStatement.GetHashCode()
注解
同一权限的两个实例的哈希代码可能不同,因此,不应使用哈希代码来比较两个 PolicyStatement 对象。The hash code for two instances of the same permission might be different, hence a hash code should not be used to compare two PolicyStatement objects.