XmlReader.ReadElementString reads a text-only element.
Imports System
Imports System.Xml
publicclass Sample
privateconst filename as string = "book.xml"
public shared Sub Main()
Dim reader as XmlTextReader = Nothing
try
reader = new XmlTextReader(filename)
reader.WhitespaceHandling = WhitespaceHandling.None
reader.MoveToContent()
Console.WriteLine("Content of the price element: {0}", reader.ReadElementString())
finallyif Not reader Is Nothing
reader.Close()
End if
End try
End Sub
End class