TextWriter.Encoding 属性

定义

当在派生类中重写时,返回用来写输出的该字符编码。When overridden in a derived class, returns the character encoding in which the output is written.

public:
 abstract property System::Text::Encoding ^ Encoding { System::Text::Encoding ^ get(); };
public abstract System.Text.Encoding Encoding { get; }
member this.Encoding : System.Text.Encoding
Public MustOverride ReadOnly Property Encoding As Encoding

属性值

用来写入输出的字符编码。The character encoding in which the output is written.

注解

对于必须编写包含所使用TextWriter编码的标头的某些 XML 方案,此属性是必需的。This property is necessary for some XML scenarios where a header must be written containing the encoding used by the TextWriter. 这使得 XML 代码可以使用任意TextWriter并生成正确的 XML 标头。This enables the XML code to consume an arbitrary TextWriter and generate the correct XML header.

有关常见 i/o 任务的列表, 请参阅常见 I/o 任务For a list of common I/O tasks, see Common I/O Tasks.

适用于

另请参阅