This documentation is archived and is not being maintained.

XmlWriter.Close Method

When overridden in a derived class, closes this stream and the underlying stream.

[Visual Basic]
Public MustOverride Sub Close()
[C#]
public abstract void Close();
[C++]
public: virtual void Close() = 0;
[JScript]
public abstract function Close();

Exceptions

Exception Type Condition
InvalidOperationException A call is made to write more output after Close has been called or the result of this call is an invalid XML document.

Remarks

Any elements or attributes left open are automatically closed.

Example

See Close (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: