SecurityElement 建構函式

定義

初始化 SecurityElement 類別的新執行個體。

多載

名稱 Description
SecurityElement(String)

初始化一個帶有指定標籤的新 SecurityElement 類別實例。

SecurityElement(String, String)

初始化一個新的類別實例 SecurityElement ,並使用指定的標籤和文字。

SecurityElement(String)

來源:
SecurityElement.cs
來源:
SecurityElement.cs
來源:
SecurityElement.cs
來源:
SecurityElement.cs
來源:
SecurityElement.cs

初始化一個帶有指定標籤的新 SecurityElement 類別實例。

public:
 SecurityElement(System::String ^ tag);
public SecurityElement(string tag);
new System.Security.SecurityElement : string -> System.Security.SecurityElement
Public Sub New (tag As String)

參數

tag
String

XML 元素的標籤名稱。

例外狀況

參數 tagnull

tag 參數在 XML 中無效。

範例

以下程式碼展示了使用 SecurityElement 建構子來建立新 SecurityElement 物件的方法。 此程式碼範例是本類別更大範例 SecurityElement 的一部分。

SecurityElement windowsRoleElement =
    new SecurityElement("WindowsMembership.WindowsRole");
Dim windowsRoleElement As New SecurityElement("WindowsMembership.WindowsRole")

備註

tag參數必須包含有效的 XML 標籤名稱。 用於 Escape 移除字串中的無效字元。

適用於

SecurityElement(String, String)

來源:
SecurityElement.cs
來源:
SecurityElement.cs
來源:
SecurityElement.cs
來源:
SecurityElement.cs
來源:
SecurityElement.cs

初始化一個新的類別實例 SecurityElement ,並使用指定的標籤和文字。

public:
 SecurityElement(System::String ^ tag, System::String ^ text);
public SecurityElement(string tag, string? text);
public SecurityElement(string tag, string text);
new System.Security.SecurityElement : string * string -> System.Security.SecurityElement
Public Sub New (tag As String, text As String)

參數

tag
String

XML 元素的標籤名稱。

text
String

元素內的文字內容。

例外狀況

參數 tagnull

tag text參數或參數在 XML 中是無效的。

備註

text 參數為 , null 則該建構子產生與無參數建構子相同的元素。

適用於