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 클래스의 새 인스턴스입니다

예제

다음 예제에서는 의 두 번째 instance WebPermission 만드는 방법을 보여 줍니다Copy. 이 두 번째 instance 첫 번째 instance 동일합니다.

// 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 위해 구현됩니다.

적용 대상