NamedPermissionSet.GetHashCode メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > NamedPermissionSet.GetHashCode メソッドの意味・解説 

NamedPermissionSet.GetHashCode メソッド

ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適した NamedPermissionSet オブジェクトのハッシュ コードを取得します。

名前空間: System.Security
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(False)> _
Public Overrides Function
 GetHashCode As Integer
Dim instance As NamedPermissionSet
Dim returnValue As Integer

returnValue = instance.GetHashCode
[ComVisibleAttribute(false)] 
public override int GetHashCode ()
[ComVisibleAttribute(false)] 
public:
virtual int GetHashCode () override
/** @attribute ComVisibleAttribute(false) */ 
public int GetHashCode ()
ComVisibleAttribute(false) 
public override function GetHashCode () : int

戻り値
現在の NamedPermissionSet オブジェクトのハッシュ コード。

解説解説

アクセス許可が同じ 2 つのインスタンスでもハッシュ コードが異なる場合があります。そのため、2 つの NamedPermissionSet オブジェクトを比較するときにハッシュ コードを使用することはできません。

使用例使用例

GetHashCode メソッドを使用して、NamedPermissionSet のハッシュ コードを表示する方法を次のコード例に示します。このコード例は、NamedPermissionSet クラスのトピックで取り上げているコード例の一部分です。

' The hash code for two instances of the same permission might be different,
 hence a hash code should not be used to 
' compare two named permission sets.
TextBox1.AppendText("The hash code of the original permission
 set is " + namedPS2.GetHashCode().ToString())
TextBox1.AppendText("The hash code of the copy is "
 + namedPS4.GetHashCode().ToString())
// The hash code for two instances of the same permission might be different,
 hence a hash code should not be used to 
// compare two named permission sets.
Console.WriteLine("The hash code of the original permission set
 is " + namedPS2.GetHashCode());
Console.WriteLine("The hash code of the copy is " + namedPS4.GetHashCode());
// The hash code for two instances of the same permission might be different,
 hence a hash code should not be used to 
// compare two named permission sets.
Console::WriteLine( "The hash code of the original permission set
 is {0}", namedPS2->GetHashCode() );
Console::WriteLine( "The hash code of the copy is {0}", namedPS4->GetHashCode()
 );

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
NamedPermissionSet クラス
NamedPermissionSet メンバ
System.Security 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

NamedPermissionSet.GetHashCode メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



NamedPermissionSet.GetHashCode メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS