SecurityElement.Text 屬性

定義

取得或設定 XML 項目中的文字。

public:
 property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
public string Text { get; set; }
public string? Text { get; set; }
member this.Text : string with get, set
Public Property Text As String

屬性值

XML 項目中的文字值。

例外狀況

文字在 XML 中是無效的。

範例

下列程式碼示範如何使用 Text 屬性來取得 XML 元素的文字。 此程式碼範例是針對 類別提供的較大範例的 SecurityElement 一部分。

String^ xmlTreeDescription = xmlElement->Text;
string xmlTreeDescription = xmlElement.Text;
Dim xmlTreeDescription As String = xmlElement.Text

備註

文字不應包含 XML 特殊字元。 使用 Escape 從字串中移除不正確字元。

SecurityElement如果 同時包含 TextChildrenText 則會先出現 。

適用於