Share via


StreamWriter Members

The following tables list the members exposed by the StreamWriter type.

Public Constructors

Name Description
Public Method StreamWriter Initializes a new instance of the StreamWriter class for the specified file on the specified path, using the default encoding and buffer size. If the file exists, it can be either overwritten or appended to. If the file does not exist, this constructor creates a new file.

Public Properties

Name Description
Public Property BaseStream Gets the underlying stream that interfaces with a backing store.
Public Property CurrentEncoding Gets the Encoding which this StreamWriter currently uses to write output.
Public Property Encoding Gets the Encoding in which the output is written.

Public Methods

Name Description
Public Method Close Closes the current StreamWriter object and the underlying stream.
Public Method Dispose Releases the unmanaged resources used by the StreamWriter and optionally releases the managed resources.
Public Method Flush Clears all buffers for the current writer and causes any buffered data to be written to the underlying stream.
Public Method Write Writes a character to the stream.
Public Method WriteLine Writes a string followed by a line terminator to the text stream.

See Also

Reference

StreamWriter Class
System.IO Namespace