Click or drag to resize
FileInfoOpenText Method
Creates a StreamReader with UTF8 encoding that reads from an existing text file.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public StreamReader OpenText()

Return Value

Type: StreamReader
A new StreamReader with UTF8 encoding.
Exceptions
ExceptionCondition
SecurityExceptionThe caller does not have the required permission.
FileNotFoundExceptionThe file is not found.
UnauthorizedAccessExceptionpath is read-only or is a directory.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
See Also