![]() ![]() | ||
After you've opened a file for writing using the FileStream class (see "Using the FileStream Class" in this chapter), you can create a StreamWriter object to write text to the file. Here is the hierarchy of the StreamWriter class:
Object MarshalByRefObject TextWriter StreamWriter
You can find the more notable public properties of the StreamWriter class in Table 13.12, and the more notable methods in Table 13.13.
Property |
Means |
---|---|
AutoFlush |
Gets/sets if the StreamWriter will flush its buffer after Write or WriteLine operation. |
BaseStream |
Gets the base stream for this stream, giving you access to the base stream's properties and methods. |
Encoding |
Gets the character encoding for this stream. |
Method |
Means |
---|---|
Close |
Closes the current stream. |
Flush |
Flushes all buffers for the stream writer, writing any buffered data to the base stream. |
Write |
Writes data to the stream. |
![]() ![]() | ||