BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.IO.TextWriter System.Runtime.InteropServices.ComVisible(true)

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.

[<topic://cpconwritingtexttofile>]

Write to a text file.

[<topic://cpconwritingtexttofile>]

Read from a text file.

[<topic://cpconreadingtextfromfile>]

Append text to a file.

[<topic://cpconopeningappendingtologfile>]

Get the size of a file.

Get the attributes of a file.

Set the attributes of a file.

Determine if a file exists.

Read from a binary file.

[<topic://cpconReadingWritingToNewlyCreatedDataFile>]

Write to a binary file.

[<topic://cpconReadingWritingToNewlyCreatedDataFile>]

Implements a for writing information to a string. The information is stored in an underlying .

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  A new is automatically created and associated with the new StringWriter.

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Initializes a new instance of the class.

  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Initializes a new instance of the class with the specified format control.

  An object that controls formatting.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is .

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Initializes a new instance of the class that writes to the specified .

  The StringBuilder to write to.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is .
  An object that controls formatting.

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Initializes a new instance of the class that writes to the specified and has the specified format provider.

  The StringBuilder to write to.
  An object that controls formatting.
  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  For an example of creating a file and writing text to a file, see [<topic://cpconwritingtexttofile>]. For an example of reading text from a file, see [<topic://cpconreadingtextfromfile>]. For an example of reading from and writing to a binary file, see [<topic://cpconReadingWritingToNewlyCreatedDataFile>].

  This method overrides .

  This implementation of Close calls the method passing a true value.

  Flushing the stream will not flush its underlying encoder unless you explicitly call Close. Setting to true means that data will be flushed from the buffer to the stream, but the encoder state will not be flushed. This allows the encoder to keep its state (partial characters) so that it can encode the next block of characters correctly. This scenario affects UTF8 and UTF7 where certain characters can only be encoded after the encoder receives the adjacent character or characters.

  Closes the current and the underlying stream.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the Dispose method of each referenced object.

  Releases the unmanaged resources used by the and optionally releases the managed resources.

  true to release both managed and unmanaged resources; false to release only unmanaged resources. 0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding

  The in which the output is written.

  This property is necessary for some XML scenarios where a header must be written containing the encoding used by the StringWriter. This allows the XML code to consume an arbitrary StringWriter 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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Gets the in which the output is written.

  0
- Method
  4.0.0.0
  System.Threading.Tasks.Task To be added.

  Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

  A task that represents the asynchronous flush operation.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.StringBuilder

  This is either the StringBuilder that was passed to the constructor, or the StringBuilder that was automatically created.

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Returns the underlying .

  The underlying StringBuilder.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Returns a string containing the characters written to the current StringWriter so far.

  The string containing the characters written to the current StringWriter.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` The writer is closed.

  This method overrides .

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Writes a character to the string.

  The character to write. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` The writer is closed.

  This method overrides .

  If the specified string is null, nothing is written.

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Writes a string to the current string.

  The string to write. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` `` `` is .

  < 0

  -or-

  < zero.

  ( + ) > Length. The writer is closed.

  This method overrides .

  This method writes characters of data to this StringWriter from , starting at position .

  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.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Append text to a file.

  [<topic://cpconopeningappendingtologfile>]

  Get the size of a file.

  Get the attributes of a file.

  Set the attributes of a file.

  Determine if a file exists.

  Read from a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Write to a binary file.

  [<topic://cpconReadingWritingToNewlyCreatedDataFile>]

  Writes a subarray of characters to the string.

  The character array to write data from. The position in the buffer at which to start reading data. The maximum number of characters to write. 0
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` To be added.

  Writes a character to the string asynchronously.

  A task that represents the asynchronous write operation.

  The character to write to the string.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` To be added.

  Writes a string to the current string asynchronously.

  A task that represents the asynchronous write operation.

  The string to write. If is null, nothing is written to the text stream.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` `` To be added.

  Writes a subarray of characters to the string asynchronously.

  A task that represents the asynchronous write operation.

  The character array to write data from. The position in the buffer at which to start reading data. The maximum number of characters to write.
- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  The line terminator is defined by the property.

  Writes a character followed by a line terminator asynchronously to the string.

  A task that represents the asynchronous write operation.

  The character to write to the string.
- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  The line terminator is defined by the property.

  Writes a string followed by a line terminator asynchronously to the current string.

  A task that represents the asynchronous write operation.

  The string to write. If the value is null, only a line terminator is written.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` ``

  The line terminator is defined by the property.

  Writes a subarray of characters followed by a line terminator asynchronously to the string.

  A task that represents the asynchronous write operation.

  The character array to write data from. The position in the buffer at which to start reading data. The maximum number of characters to write.
0