TextWriter Constructor

TextWriter Constructor

.NET Framework 1.1

Overload List

Initializes a new instance of the TextWriter class.

Supported by the .NET Compact Framework.

[Visual Basic] Protected Sub New()
[C#] protected TextWriter();
[C++] protected: TextWriter();
[JScript] protected function TextWriter();

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

Supported by the .NET Compact Framework.

[Visual Basic] Protected Sub New(IFormatProvider)
[C#] protected TextWriter(IFormatProvider);
[C++] protected: TextWriter(IFormatProvider*);
[JScript] protected function TextWriter(IFormatProvider);


[Visual Basic, C#, C++] This code example is part of a larger example provided for the TextWriter class.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of the TextWriter constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Dim aStringWriter, aStreamWriter As TextWriter
aStringWriter = New StringWriter()
aStreamWriter = New StreamWriter("InvalidPathChars.txt")

TextWriter stringWriter = new StringWriter();
using(TextWriter streamWriter = 
    new StreamWriter("InvalidPathChars.txt"))

TextWriter* stringWriter = new StringWriter(); 
TextWriter* streamWriter = 
    new StreamWriter("InvalidPathChars.txt");

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

TextWriter Class | TextWriter Members | System.IO Namespace

© 2015 Microsoft