O'Reilly logo

Special Edition Using® Microsoft® ASP.NET by Richard Leinecker

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

The File and StreamReader Classes

The Directory class offers a lot to developers. Now that we’ve covered that, we’ll move on to another important class. The File class aids in the creation of FileStream objects and provides routines for the creation, copying, deletion, moving, and opening of files.

The StreamReader class implements a TextReader that reads characters from a byte stream in a particular encoding. StreamReader is designed for character input in a particular encoding, whereas the Stream class is designed for byte input and output.

StreamReader defaults to UTF-8 encoding, rather than the ANSI code page for the current system, unless specified otherwise. UTF-8 handles Unicode characters correctly and gives consistent results on localized ...

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