How to use C# Textreader Class

Textreader and TextWriter are the another way to read and write file respectively, even though these are not stream classes. Textreader represents a reader that can read a sequential series of characters. The StreamReader and StreamWriter classes are derived from TextReader and TextWriter classes respectively, which read characters from streams and strings.

The following C# source code shows how to read a file using TextReader.