Answer: StreamReader is a class used in Dot Net to read Text files.As name suggests it reads data from a byte stream.Actually it implements a System.IO.TextReader that reads characters from a byte stream in a particular encoding.
We have to give a proper file path in its constructor otherwise it will give FileNotFound error.
Syntax:-
StreamReader sr = new StreamReader("path of the file");
Asked In: Many Interviews |
Alert Moderator