共用方式為


IPermission.Copy 方法

定義

建立並傳回目前權限的相同複本。

public:
 System::Security::IPermission ^ Copy();
public System.Security.IPermission Copy ();
abstract member Copy : unit -> System.Security.IPermission
Public Function Copy () As IPermission

傳回

目前權限的複本。

範例

下列程式代碼範例示範如何實作 Copy 方法。 此程式代碼範例是提供給 介面之較大範例的 IPermission 一部分。

    // Return a new object that matches 'this' object's permissions.
public:
    virtual IPermission^ Copy () override sealed
    {
        return (IPermission^) Clone();
    }
// Return a new object that matches 'this' object's permissions.
public sealed override IPermission Copy()
{
    return (IPermission)Clone();
}
' Return a new object that matches 'this' object's permissions.
Public Overrides Function Copy() As IPermission
    Return CType(Clone(), IPermission)

End Function 'Copy

備註

許可權的複本代表與原始許可權相同的資源存取權。

適用於