Share via


WebPermission.Copy メソッド

定義

WebPermission のコピーを作成します。

public:
 override System::Security::IPermission ^ Copy();
public override System.Security.IPermission Copy ();
override this.Copy : unit -> System.Security.IPermission
Public Overrides Function Copy () As IPermission

戻り値

元のクラスと同じ値を持つ WebPermission クラスの新しいインスタンス。

次の例では、 を使用して の 2 つ目の WebPermission インスタンスを作成する方法を Copy示します。 この 2 番目のインスタンスは、最初の インスタンスと同じです。

// Create another WebPermission instance that is the copy of the above WebPermission instance.
WebPermission^ myWebPermission2 = (WebPermission^)(myWebPermission1->Copy());

// Check whether all callers higher in the call stack have been granted the permissionor not.
myWebPermission2->Demand();
 // Create another WebPermission instance that is the copy of the above WebPermission instance.
  WebPermission myWebPermission2 = (WebPermission) myWebPermission1.Copy();

 // Check whether all callers higher in the call stack have been granted the permissionor not.
 myWebPermission2.Demand();
' Create another WebPermission instance that is the copy of the above WebPermission instance.
Dim myWebPermission2 As WebPermission = CType(myWebPermission1.Copy(), WebPermission)

' Check whether all callers higher in the call stack have been granted the permissionor not.
myWebPermission2.Demand()

注釈

このメソッドによって返される は IPermission 、元 WebPermissionの と同じリソースへのアクセスを表します。 このメソッドは を Copy オーバーライドし、 インターフェイスをサポート IPermission するために実装されます。

適用対象