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

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

GacIdentityPermission.Copy メソッド

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

現在のアクセス許可コピー作成して返します

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

Public Overrides Function
 Copy As IPermission
Dim instance As GacIdentityPermission
Dim returnValue As IPermission

returnValue = instance.Copy
public override IPermission Copy ()
public IPermission Copy ()

戻り値
現在のアクセス許可コピー

解説解説
使用例使用例

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

'Copy creates and returns an identical copy of the current permission.
Private Function CopyDemo() As
 Boolean

    Dim Gac1 As New GacIdentityPermission
    Dim Gac2 As New GacIdentityPermission
    Console.WriteLine("**************************************************************************")
    Try
        Gac2 = CType(Gac1.Copy(), GacIdentityPermission)
        If Not (Gac2 Is
 Nothing) Then
            Console.WriteLine(("Result of copy = "
 & Gac2.ToString() & ControlChars.Lf))
        End If

    Catch e As Exception
        Console.WriteLine(("Copy failed : " &
 Gac1.ToString() & e.ToString()))
        Return False
    End Try

    Return True
End Function 'CopyDemo

//Copy creates and returns an identical copy of the current permission.
private bool CopyDemo()
{

    GacIdentityPermission Gac1 = new GacIdentityPermission();
    GacIdentityPermission Gac2 = new GacIdentityPermission();
    Console.WriteLine("**************************************************************************");
    try
    {
        Gac2 = (GacIdentityPermission)Gac1.Copy();
        if (Gac2 != null)
        {
            Console.WriteLine("Result of copy = " + Gac2.ToString() + "\n");
        }

    }
    catch (Exception e)
    {
        Console.WriteLine("Copy failed : " + Gac1.ToString() + e);
        return false;
    }

    return true;

}
//Copy creates and returns an identical copy of the current permission.
bool CopyDemo()
{
   GacIdentityPermission ^ Gac1 = gcnew GacIdentityPermission;
   GacIdentityPermission ^ Gac2 = gcnew GacIdentityPermission;
   Console::WriteLine( "**************************************************************************"
 );
   try
   {
      Gac2 = dynamic_cast<GacIdentityPermission^>(Gac1->Copy());
      if ( Gac2 != nullptr )
      {
         Console::WriteLine( "Result of copy = {0}\n", Gac2 );
      }
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Copy failed : {0}{1}", Gac1, e );
      return false;
   }

   return true;
}


// Copy creates and returns an identical copy of the current permission.
private boolean CopyDemo()
{
    GacIdentityPermission gac1 = new GacIdentityPermission();
    GacIdentityPermission gac2 = new GacIdentityPermission();
    Console.WriteLine("****************************************" 
        + "**********************************");
    
    try {
        gac2 = ((GacIdentityPermission)(gac1.Copy()));
        if (gac2 != null) {
            Console.WriteLine(("Result of copy = " 
                + gac2.ToString() + "\n"));
        }
    }
    catch (System.Exception e) {
        Console.WriteLine(("Copy failed : " + gac1.ToString() + e));
        return false;
    }
    return true;
} //CopyDemo
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GacIdentityPermission クラス
GacIdentityPermission メンバ
System.Security.Permissions 名前空間



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS