Export (0) Print
Expand All

XmlWriter.WriteComment Method

When overridden in a derived class, writes out a comment <!--...--> containing the specified text.

[Visual Basic]
Public MustOverride Sub WriteComment( _
   ByVal text As String _
)
[C#]
public abstract void WriteComment(
 string text
);
[C++]
public: virtual void WriteComment(
 String* text
) = 0;
[JScript]
public abstract function WriteComment(
   text : String
);

Parameters

text
Text to place inside the comment.

Exceptions

Exception Type Condition
ArgumentException The text would result in a non-well formed XML document.

Remarks

If text is either a null reference (Nothing in Visual Basic) or String.Empty, this method writes a Comment with no data content, for example <!---->.

Example

See WriteComment (in the XmlTextWriter class) for an example using this method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlWriter Class | XmlWriter Members | System.Xml Namespace

Show:
© 2014 Microsoft