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

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

UrlIdentityPermission.Copy メソッド

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

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

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

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

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

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

        Dim returnValue As Boolean
 = True
        Dim url1 As String
 = ""
        Dim url2 As String
 = ""
        Dim urlIdPerm1, urlIdPerm2 As UrlIdentityPermission
        Dim urlGen1 As New
 UrlGenerator()
        Dim urlGen2 As New
 UrlGenerator()

        urlGen1.ResetIndex()
        While urlGen1.CreateUrl(url1)
            urlIdPerm1 = New UrlIdentityPermission(url1)
            urlGen2.ResetIndex()
            Console.WriteLine("********************************************************\n")
            Try
                urlIdPerm2 = CType(urlIdPerm1.Copy(), UrlIdentityPermission)
                If Not (urlIdPerm2 Is
 Nothing) Then
                    Console.WriteLine("Result of copy = "
 & urlIdPerm2.ToString() & ControlChars.Lf)
                Else
                    Console.WriteLine("Result of copy is null.
 " & ControlChars.Lf)
                End If
            Catch e As Exception
                If (True.ToString()) Then
                    If url1 = ""
 Then
                        Console.WriteLine("The target UrlIdentityPermission
 is empty; copy failed.")

                    Else
                        Console.WriteLine(e.ToString())
                    End If
                End If
                GoTo ContinueWhile1
            End Try
ContinueWhile1:
        End While
        Return returnValue
    End Function 'CopyDemo

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

    bool returnValue = true;
    string url1;
    UrlIdentityPermission urlIdPerm1, urlIdPerm2;
    UrlGenerator urlGen1 = new UrlGenerator();
    UrlGenerator urlGen2 = new UrlGenerator();

    urlGen1.ResetIndex();
    while (urlGen1.CreateUrl(out url1))
    {
        urlIdPerm1 = new UrlIdentityPermission(url1);
        urlGen2.ResetIndex();
        Console.WriteLine("********************************************************\n");
        try
        {
            urlIdPerm2 = (UrlIdentityPermission)urlIdPerm1.Copy();
            if (urlIdPerm2 != null)
            {
                Console.WriteLine("Result of copy = " + urlIdPerm2.ToString()
 + "\n");
            }
            else
            {
                Console.WriteLine("Result of copy is null.
 \n");
            }
        }
        catch (Exception e)
        {
            {
                if (url1 == "")
                {
                    Console.WriteLine("The target UrlIdentityPermission is empty;
 copy failed.");

                }
                else
                    Console.WriteLine(e);
            }
            continue;
        }
    }
    return returnValue;
}
//Copy creates and returns an identical copy of the current permission.
private boolean CopyDemo()
{
    boolean returnValue = true;
    String url1[] = new String[1];
    UrlIdentityPermission urlIdPerm1[] = new UrlIdentityPermission[1];
    UrlIdentityPermission urlIdPerm2[] = new UrlIdentityPermission[1];
    UrlGenerator urlGen1 = new UrlGenerator();
    UrlGenerator urlGen2 = new UrlGenerator();

    urlGen1.ResetIndex();
    while (urlGen1.CreateUrl(urlIdPerm1, url1)) {
        if (urlIdPerm1 == null) {
            continue;
        }
        urlGen2.ResetIndex();
        Console.WriteLine("**********************************************"
 
            + "**********\n");
        try {
            urlIdPerm2[0] = ((UrlIdentityPermission)(urlIdPerm1[0].Copy()));
            if (urlIdPerm2 != null) {
                Console.WriteLine(("Result of copy = " + urlIdPerm2[0].
                ToString() + "\n"));
            }
            else {
                Console.WriteLine("Result of copy is null.
 \n");
            }
        }
        catch (System.Exception e) {
            {
                if (url1[0].Equals("")) {
                    Console.WriteLine("The target UrlIdentityPermission"
 
                        + " is empty; copy failed.");
                }
                else {
                    Console.WriteLine(e);
                }
            }
            continue;
        }
    }
    return returnValue;
} //CopyDemo
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
UrlIdentityPermission クラス
UrlIdentityPermission メンバ
System.Security.Permissions 名前空間



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS