Export (0) Print
Expand All

TextWriter.Encoding Property

When overridden in a derived class, returns the Encoding in which the output is written.

[Visual Basic]
Public MustOverride ReadOnly Property Encoding As Encoding
[C#]
public abstract Encoding Encoding {get;}
[C++]
public: __property virtual Encoding* get_Encoding() = 0;
[JScript]
public abstract function get Encoding() : Encoding;

Property Value

The Encoding in which the output is written.

Remarks

This property is necessary for some XML scenarios where a header must be written containing the encoding used by the TextWriter. This allows the XML code to consume an arbitrary TextWriter and generate the correct XML header.

The following table lists examples of other typical or related I/O tasks.

To do this... See the example in this topic...
Create a text file. Writing Text to a File
Write to a text file. Writing Text to a File
Read from a text file. Reading Text from a File

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

TextWriter Class | TextWriter Members | System.IO Namespace | Working with I/O | Reading Text from a File | Writing Text to a File

Show:
© 2014 Microsoft