WebPermission.Copy Metodo

Definizione

Crea una copia di una classe 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

Restituisce

Nuova istanza della classe WebPermission che dispone degli stessi valori dell'originale.

Esempio

Nell'esempio seguente viene illustrato come creare una seconda istanza di WebPermission usando Copy. Questa seconda istanza è identica alla prima.

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

Commenti

Il IPermission valore restituito da questo metodo rappresenta lo stesso accesso alle risorse dell'originale WebPermission. Questo metodo esegue l'override Copy e viene implementato per supportare l'interfaccia IPermission .

Si applica a