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

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

GacIdentityPermission.Intersect メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

現在のアクセス許可指定したアクセス許可積集合を表すアクセス許可作成して返します

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

Public Overrides Function
 Intersect ( _
    target As IPermission _
) As IPermission
Dim instance As GacIdentityPermission
Dim target As IPermission
Dim returnValue As IPermission

returnValue = instance.Intersect(target)
public override IPermission Intersect (
    IPermission target
)
public:
virtual IPermission^ Intersect (
    IPermission^ target
) override
public IPermission Intersect (
    IPermission target
)
public override function Intersect (
    target : IPermission
) : IPermission

パラメータ

target

現在のアクセス許可との積集合を持つアクセス許可。これは、現在のアクセス許可と同じ型であることが必要です。

戻り値
現在のアクセス許可指定したアクセス許可積集合を表す新しアクセス許可積集合が空の場合新しアクセス許可null 参照 (Visual Basic では Nothing) です。

例外例外
例外種類条件

ArgumentException

targetnull 参照 (Visual Basic では Nothing) ではなく現在のアクセス許可と同じ型でもありません。

解説解説
使用例使用例

Intersect メソッド使用するコード例次に示します。このコード例は、GacIdentityPermission クラストピック取り上げているコード例一部分です。

' Intersect creates and returns a new permission that is the intersection
 of the 
' current permission and the specified permission.
Private Function IntersectDemo() As
 Boolean
    Dim Gac1 As New GacIdentityPermission
    Dim Gac2 As New GacIdentityPermission
    Try
        Dim p3 As GacIdentityPermission = CType(Gac1.Intersect(Gac2),
 GacIdentityPermission)
        If Not (p3 Is Nothing)
 Then
            Console.WriteLine(("The intersection of the two permissions
 = " & p3.ToString() & ControlChars.Lf))

        Else
            Console.WriteLine("The intersection of the two permissions
 is null." & ControlChars.Lf)
        End If
    Catch e As Exception
        Console.WriteLine(("An exception was thrown : "
 & e.ToString()))
        Return False
    End Try

    Return True
End Function 'IntersectDemo

// Intersect creates and returns a new permission that is the intersection
 of the
// current permission and the specified permission.
private bool IntersectDemo()
{
    GacIdentityPermission Gac1 = new GacIdentityPermission();
    GacIdentityPermission Gac2 = new GacIdentityPermission();
    try
    {
        GacIdentityPermission p3 = (GacIdentityPermission)Gac1.Intersect(Gac2);
        if (p3 != null)
        {
            Console.WriteLine("The intersection of the two permissions = "
 + p3.ToString() + "\n");

        }
        else
        {
            Console.WriteLine("The intersection of the two permissions is null.\n");
        }
    }
    catch (Exception e)
    {
        Console.WriteLine("An exception was thrown : " + e);
        return false;

    }

    return true;

}
// Intersect creates and returns a new permission that is the intersection
 of the 
// current permission and the specified permission.
bool IntersectDemo()
{
   GacIdentityPermission ^ Gac1 = gcnew GacIdentityPermission;
   GacIdentityPermission ^ Gac2 = gcnew GacIdentityPermission;
   try
   {
      GacIdentityPermission ^ p3 = dynamic_cast<GacIdentityPermission^>(Gac1->Intersect(
 Gac2 ));
      if ( p3 != nullptr )
      {
         Console::WriteLine( "The intersection of the two permissions = {0}\n",
 p3 );
      }
      else
      {
         Console::WriteLine( "The intersection of the two permissions is null.\n"
 );
      }
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "An exception was thrown : {0}", e );
      return false;
   }

   return true;
}


// Intersect creates and returns a new permission that is the 
// intersection of the current permission and the specified permission.
private boolean IntersectDemo()
{
    GacIdentityPermission gac1 = new GacIdentityPermission();
    GacIdentityPermission gac2 = new GacIdentityPermission();

    try {
        GacIdentityPermission p3 = 
            ((GacIdentityPermission)(gac1.Intersect(gac2)));
        if (p3 != null) {
            Console.WriteLine(("The intersection of the two permissions = "
 
                + p3.ToString() + "\n"));
        }
        else {
            Console.WriteLine("The intersection of the two permissions "
 
                + "is null.\n");
        }
    }
    catch (System.Exception e) {
        Console.WriteLine(("An exception was thrown : " + e));
        return false;
    }
    return true;
} //IntersectDemo    
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GacIdentityPermission クラス
GacIdentityPermission メンバ
System.Security.Permissions 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

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

   

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



GacIdentityPermission.Intersect メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS