TextWriter 构造函数

定义

初始化 TextWriter 类的新实例。

重载

TextWriter()

初始化 TextWriter 类的新实例。

TextWriter(IFormatProvider)

使用指定的格式提供程序初始化 TextWriter 类的新实例。

TextWriter()

Source:
TextWriter.cs
Source:
TextWriter.cs
Source:
TextWriter.cs

初始化 TextWriter 类的新实例。

protected:
 TextWriter();
protected TextWriter ();
Protected Sub New ()

注解

如果不想为 FormatProvider 属性提供值,请使用此构造函数重载。 FormatProvider当 属性为 null时,当前线程的区域性用于格式设置。

将此构造函数用于派生类。

有关常见 I/O 任务的列表,请参阅 常见 I/O 任务

另请参阅

适用于

TextWriter(IFormatProvider)

Source:
TextWriter.cs
Source:
TextWriter.cs
Source:
TextWriter.cs

使用指定的格式提供程序初始化 TextWriter 类的新实例。

protected:
 TextWriter(IFormatProvider ^ formatProvider);
protected TextWriter (IFormatProvider formatProvider);
protected TextWriter (IFormatProvider? formatProvider);
new System.IO.TextWriter : IFormatProvider -> System.IO.TextWriter
Protected Sub New (formatProvider As IFormatProvider)

参数

formatProvider
IFormatProvider

控制格式设置的 IFormatProvider 对象。

注解

使用此构造函数重载为 属性提供值 FormatProvider 。 属性的值 FormatProvider 指定在调用 WriteWriteLine 方法时使用的区域性特定格式。 如果不想提供格式提供程序,请使用 构造函数创建实例 TextWriter() ,该构造函数将 FormatProvider 属性设置为 nullFormatProvider当 属性为 null时,当前线程的区域性用于格式设置。

有关常见 I/O 任务的列表,请参阅 常见 I/O 任务

另请参阅

适用于