System.Xml.XmlReader.Read Method

When overridden in a derived class, reads the next node from the stream.

Syntax

public abstract bool Read ()

Returns

true if the next node was read successfully; false if there are no more nodes to read.

Exceptions

TypeReason
System.Xml.XmlExceptionAn error occurred while parsing the XML.

Remarks

When an XmlReader is first created and initialized, there is no information available. You must call Read to read the first node.

This method requires at least four bytes from the data stream in order to begin parsing. If fewer than four bytes are returned and there is no more data in the stream, the method will fail. If there is more data in the stream, the method will block parsing until receipt of the fourth byte.

For the asynchronous version of this method, see XmlReader.ReadAsync.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0