Export (0) Print
Expand All

SecurityElement.FromString Method

Creates a security element from an XML-encoded string.

Namespace:  System.Security
Assembly:  mscorlib (in mscorlib.dll)

public static SecurityElement FromString(
	string xml
)

Parameters

xml
Type: System.String

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

Return Value

Type: System.Security.SecurityElement
A SecurityElement created from the XML.

ExceptionCondition
XmlSyntaxException

xml contains one or more single quotation mark characters.

ArgumentNullException

xml is null.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft