O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Closing the XmlTextReader

The XmlTextReader should be explicitly closed whenever possible. Explicitly closing it will free up any resources that may be in use while reading the stream. These could be file handles, Web response streams, sockets, or just plain string data. Letting the XmlTextReader go out of scope is not an acceptable way to free up these resources. Besides, explicitly closing the reader is a deterministic way to free up resources. That means there is no reason to guess when resources are available or to attempt to program around resources that are stuck in limbo.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required