streamwriter_object.Close Method

Closes the file or device associated with a StreamWriter Object.

steamwriter_object.Close

Prerequisites

None

Parameters

None

Remarks

This method closes the file or device that is associated with a StreamWriter Object. Any pending buffered output is written before the close completes.

If buffered output is being written, this method blocks until the output is complete.

If any I/O error occurs, this method throws an Exception. No error occurs if the file or device is not currently open.

Examples

streamwriter_object.Close()

See Also

File and Serial I/O | New StreamWriter