Share via


SecurityElement.FromString(String) 方法

定義

從 XML 編碼字串建立安全性項目。

public:
 static System::Security::SecurityElement ^ FromString(System::String ^ xml);
public static System.Security.SecurityElement FromString (string xml);
public static System.Security.SecurityElement? FromString (string xml);
static member FromString : string -> System.Security.SecurityElement
Public Shared Function FromString (xml As String) As SecurityElement

參數

xml
String

用來建立安全性項目的 XML 編碼字串。

傳回

從 XML 建立的 SecurityElement

例外狀況

xml 包含一或多個單引號字元。

xmlnull

備註

請勿在 XML 字串中使用單引號;請改用逸出的雙引號。 例如,而不是使用<value name='Company'>Microsoft</value>"<value name=\"Company\">Microsoft</value>"

使用單引號可能會導致擲回例外狀況,或在某些情況下,將單引號視為字串中的文字。

.NET Core 不支援以辨識項為基礎的安全性模型,此方法會傳回 null

適用於