Export (0) Print
Expand All

PermissionSet.FromXml Method

Reconstructs a security object with a specified state from an XML encoding.

[Visual Basic]
Public Overridable Sub FromXml( _
   ByVal et As SecurityElement _
) Implements ISecurityEncodable.FromXml
[C#]
public virtual void FromXml(
 SecurityElement et
);
[C++]
public: virtual void FromXml(
 SecurityElement* et
);
[JScript]
public function FromXml(
   et : SecurityElement
);

Parameters

et
The XML encoding to use to reconstruct the security object.

Implements

ISecurityEncodable.FromXml

Exceptions

Exception Type Condition
ArgumentNullException The et parameter is a null reference (Nothing in Visual Basic).
ArgumentException The et parameter is not a valid permission element.

-or-

The et parameter's version number is not supported.

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:
© 2014 Microsoft