We have to import System.IO namespace to work with StreamReader class.
Actually System.IO namespace is used to work with File handling operations like reading files and writing into files.
It contain types that support input and output.
The System.IO namespace has various classes that are used for performing various operation with files such as creating and deleting files,reading from or writing to a file,closing a file.
In short,whenever we want to work with files,then we have to use System.IO namespace.
Asked In: Many Interviews |