Share via


DataProtectionPermission.FromXml(SecurityElement) 메서드

정의

XML 인코딩에서 특정 상태를 가진 사용 권한을 다시 생성합니다.

public:
 override void FromXml(System::Security::SecurityElement ^ securityElement);
public override void FromXml (System.Security.SecurityElement securityElement);
override this.FromXml : System.Security.SecurityElement -> unit
Public Overrides Sub FromXml (securityElement As SecurityElement)

매개 변수

securityElement
SecurityElement

사용 권한을 다시 생성하는 데 사용된 XML 인코딩을 포함하는 SecurityElement 입니다.

예외

securityElement이(가) null인 경우

securityElement 가 올바른 사용 권한 요소가 아닙니다.

또는

securityElement의 버전 번호가 지원되지 않는 경우

예제

다음 코드 예제에서는 사용 하는 메서드입니다 FromXml . 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataProtectionPermission 클래스입니다.

참고

코드 예제는 메서드의 동작을 표시하기 위한 것이며, 메서드의 사용을 보여 주는 것이 아닙니다. 으로 보안 인프라를 권한 클래스의 메서드를 사용 하는 일반적으로 애플리케이션에서 사용 되지 됩니다.

Console::WriteLine( "Using an XML round trip to reset the fourth "
"permission." );
sp4->FromXml( sp2->ToXml() );
rc = sp4->Equals( sp2 );
Console::WriteLine( "Does the XML round trip result equal the "
"original permission? {0}", (rc ? (String^)"Yes" : "No") );
Console.WriteLine("Using an XML round trip to reset the fourth " +
    "permission.");
sp4.FromXml(sp2.ToXml());
rc = sp4.Equals(sp2);
Console.WriteLine("Does the XML round trip result equal the " +
    "original permission? " + (rc ? "Yes" : "No"));
    Console.WriteLine("Using an XML round trip to reset the fourth " + "permission.")
    sp4.FromXml(sp2.ToXml())
    rc = sp4.Equals(sp2)
    Console.WriteLine("Does the XML round trip result equal the " + "original permission? " + IIf(rc, "Yes", "No")) 'TODO: For performance reasons this should be changed to nested IF statements

End Sub

설명

메서드는 FromXml 클래스에 의해 SecurityElement 정의된 XML 인코딩에서 개체를 다시 구성 DataProtectionPermission 합니다. 메서드를 ToXml 사용하여 상태 정보를 포함하여 를 XML로 인코딩 DataProtectionPermission합니다.

적용 대상