Writes the text representation of an object by calling the ToString method on that object, followed by a line terminator to the text string or stream.
Type Reason System.IO.IOException An I/O error occurred.
This overload is equivalent to the TextWriter.Write(string, object) overload. The TextWriter.FormatProvider property, if not null, specifies the culture-specific formatting.
The line terminator is defined by the TextWriter.CoreNewLine field.
For a list of common I/O tasks, see Common I/O Tasks.