C# StreamReader StreamReader(String, Boolean)
Description
StreamReader StreamReader(String, Boolean)
Initializes
a new instance of the StreamReader class for the specified file name, with
the specified byte order mark detection option.
Syntax
StreamReader.StreamReader(String, Boolean)
has the following syntax.
public StreamReader(
string path,
bool detectEncodingFromByteOrderMarks
)
Parameters
StreamReader.StreamReader(String, Boolean)
has the following parameters.
path
- The complete file path to be read.detectEncodingFromByteOrderMarks
- Indicates whether to look for byte order marks at the beginning of the file.
Example
using System;// w w w . ja v a2 s . c o m
using System.IO;
public class MainClass{
public static void Main(String[] argv){
StreamReader sr = new StreamReader("C:\\Temp\\Test.txt",false);
}
}