DataProtectionPermission.ToXml 메서드

정의

사용 권한 및 해당 사용 권한의 현재 상태에 대한 XML 인코딩을 만듭니다.

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

반환

SecurityElement

상태 정보를 포함하는 사용 권한의 XML 인코딩입니다.

예제

다음 코드 예제에서는 메서드의 사용을 보여 있습니다 ToXml . 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 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.

적용 대상