通过


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;
Dim xmlTreeDescription As String = xmlElement.Text

注解

文本不应包含 XML 特殊字符。 用于 Escape 从字符串中删除无效字符。

如果包含这两TextSecurityElement,并且 TextChildren将首先出现。

适用于