Edit

Bagikan melalui


SecurityElement.Text Property

Definition

Gets or sets the text within an XML element.

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

Property Value

The value of the text within an XML element.

Exceptions

The text is not valid in XML.

Examples

The following code shows the use of the Text property to get the text of an XML element. This code example is part of a larger example provided for the SecurityElement class.

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

Remarks

The text should not contain XML special characters. Use Escape to remove invalid characters from the string.

If a SecurityElement contains both Text and Children, Text will appear first.

Applies to