Bagikan melalui


WebPermission.Copy Metode

Definisi

Membuat salinan 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

Mengembalikan

Instans WebPermission baru kelas yang memiliki nilai yang sama dengan aslinya.

Contoh

Contoh berikut menunjukkan cara membuat instans kedua menggunakan WebPermissionCopy. Instans kedua ini identik dengan instans pertama.

// 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()

Keterangan

yang IPermission dikembalikan oleh metode ini mewakili akses yang sama ke sumber daya seperti aslinya WebPermission. Metode ini mengambil alih Copy dan diimplementasikan untuk mendukung IPermission antarmuka.

Berlaku untuk