Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ToXml Method

PermissionSet.ToXml Method

Creates an XML encoding of the security object and its current state.

[Visual Basic]
Public Overridable Function ToXml() As SecurityElement Implements _
   ISecurityEncodable.ToXml
[C#]
public virtual SecurityElement ToXml();
[C++]
public: virtual SecurityElement* ToXml();
[JScript]
public function ToXml() : SecurityElement;

Return Value

An XML encoding of the security object, including any state information.

Implements

ISecurityEncodable.ToXml

Example

[Visual Basic] 
' Display result of ToXml and FromXml operations.
Dim ps6 As New PermissionSet(PermissionState.None)
ps6.FromXml(ps5.ToXml())
Console.WriteLine("Result of ToFromXml = " & ps6.ToString() & ControlChars.Lf)

[C#] 
// Display result of ToXml and FromXml operations.
PermissionSet ps6 = new PermissionSet(PermissionState.None);
ps6.FromXml(ps5.ToXml());
Console.WriteLine("Result of ToFromXml = " +ps6.ToString() + "\n");

[C++] 
// Display result of ToXml and FromXml operations.
PermissionSet* ps6 = new PermissionSet(PermissionState::None);
ps6->FromXml(ps5->ToXml());
Console::WriteLine(S"Result of ToFromXml = {0}\n", ps6);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

PermissionSet Class | PermissionSet Members | System.Security Namespace

Show:
© 2015 Microsoft