System.Security.SecurityElement.FromString Method

Creates a security element from an XML-encoded string.

Syntax

public static SecurityElement FromString (string xml)

Parameters

xml
The XML-encoded string from which to create the security element.

Returns

A System.Security.SecurityElement created from the XML.

Remarks

Do not use single quotation marks in the XML string; instead, use escaped double quotation marks. For example, instead of "<value name='Company'>Microsoft</value>" use "<value name=\"Company\">Microsoft</value>".

Using single quotation marks can result in either an exception being thrown or, in some cases, the single quotation marks being treated as text in the string.

Requirements

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0