Type Reason System.IO.IOException An I/O error occurred.
All the characters in buffer are written to the underlying stream. If the character array is null, only the line terminator is written.
This overload is equivalent to TextWriter.Write(Char[]) followed by TextWriter.WriteLine .
The line terminator is defined by the TextWriter.CoreNewLine field.
For a list of common I/O tasks, see Common I/O Tasks.