StreamReader.CurrentEncoding Property
.NET Framework 4.5
Gets the current character encoding that the current StreamReader object is using.
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Text.EncodingThe current character encoding used by the current reader. The value can be different after the first call to any Read method of StreamReader, since encoding autodetection is not done until the first call to a Read method.
For a list of common I/O tasks, see Common I/O Tasks.
The following code example gets the encoding of the specified StreamReader object.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.