Edit

Share via


TextWriter Constructors

Definition

Initializes a new instance of the TextWriter class.

Overloads

TextWriter()

Initializes a new instance of the TextWriter class.

TextWriter(IFormatProvider)

Initializes a new instance of the TextWriter class with the specified format provider.

TextWriter()

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

Initializes a new instance of the TextWriter class.

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

Remarks

Use this constructor overload when you do not want to provide a value for the FormatProvider property. When the FormatProvider property is null, the culture of the current thread is used for formatting.

Use this constructor for derived classes.

For a list of common I/O tasks, see Common I/O Tasks.

See also

Applies to

TextWriter(IFormatProvider)

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

Initializes a new instance of the TextWriter class with the specified format provider.

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)

Parameters

formatProvider
IFormatProvider

An IFormatProvider object that controls formatting.

Remarks

Use this constructor overload to provide a value for the FormatProvider property. The value of the FormatProvider property specifies the culture-specific formatting that is used when you call the Write and WriteLine methods. If you do not want to provide a format provider, you create an instance by using the TextWriter() constructor, which sets the FormatProvider property to null. When the FormatProvider property is null, the culture of the current thread is used for formatting.

For a list of common I/O tasks, see Common I/O Tasks.

See also

Applies to