XComment.Value Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the string value of this comment.
public:
property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };
public string Value { get; set; }
member this.Value : string with get, set
Public Property Value As String
Property Value
A String that contains the string value of this comment.
Exceptions
The value
is null
.
Examples
The following example creates a comment node. It then retrieves the contents of the comment node.
XComment com = new XComment("This is a comment");
Console.WriteLine(com.Value);
Dim com As XComment = New XComment("This is a comment")
Console.WriteLine(com.Value)
This example produces the following output:
This is a comment
Remarks
Unlike XElement and XAttribute, you cannot retrieve the contents of a comment by casting it to a string. Instead, you must use this property to retrieve the contents.
Setting this property will raise the Changed and the Changing events.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om