public abstract class TextWriter : MarshalByRefObject, IDisposable
Object
MarshalByRefObject
TextWriterThis type implements IDisposable.
mscorlib
BCL
Represents a writer that can write a sequential series of characters.
TextWriter is designed for character output, whereas the Stream class is designed for byte input and output.[Note: By default, a TextWriter is not thread safe. See System.IO.TextWriter.Synchronized(System.IO.TextWriter) for a thread-safe wrapper. ]
System.IO Namespace
TextWriter Constructors
TextWriter() Constructor
TextWriter(System.IFormatProvider) Constructor
TextWriter Methods
TextWriter.Close Method
TextWriter.Dispose Method
TextWriter.Flush Method
TextWriter.Synchronized Method
TextWriter.System.IDisposable.Dispose Method
TextWriter.Write(System.String, System.Object[]) Method
TextWriter.Write(System.String, System.Object, System.Object, System.Object) Method
TextWriter.Write(System.String, System.Object, System.Object) Method
TextWriter.Write(System.String, System.Object) Method
TextWriter.Write(System.Object) Method
TextWriter.Write(System.String) Method
TextWriter.Write(System.Decimal) Method
TextWriter.Write(double) Method
TextWriter.Write(float) Method
TextWriter.Write(ulong) Method
TextWriter.Write(long) Method
TextWriter.Write(uint) Method
TextWriter.Write(int) Method
TextWriter.Write(bool) Method
TextWriter.Write(char[], int, int) Method
TextWriter.Write(char[]) Method
TextWriter.Write(char) Method
TextWriter.WriteLine(System.String, System.Object[]) Method
TextWriter.WriteLine(System.String, System.Object, System.Object, System.Object) Method
TextWriter.WriteLine(System.String, System.Object, System.Object) Method
TextWriter.WriteLine(System.String, System.Object) Method
TextWriter.WriteLine(System.Object) Method
TextWriter.WriteLine(System.String) Method
TextWriter.WriteLine(System.Decimal) Method
TextWriter.WriteLine(double) Method
TextWriter.WriteLine(float) Method
TextWriter.WriteLine(ulong) Method
TextWriter.WriteLine(long) Method
TextWriter.WriteLine(uint) Method
TextWriter.WriteLine(int) Method
TextWriter.WriteLine(bool) Method
TextWriter.WriteLine(char[], int, int) Method
TextWriter.WriteLine(char[]) Method
TextWriter.WriteLine(char) Method
TextWriter.WriteLine() Method
TextWriter Fields
TextWriter Properties
TextWriter.Encoding Property
TextWriter.FormatProvider Property
TextWriter.NewLine Property
protected TextWriter();
Constructs and initializes a new instance of the TextWriter class.
System.IO.TextWriter Class, System.IO Namespace
protected TextWriter(IFormatProvider formatProvider);
Constructs and initializes a new instance of the TextWriter class with the specified format provider.
- formatProvider
- A IFormatProvider object that supplies a formatting object.
System.IO.TextWriter Class, System.IO Namespace
public virtual void Close();
Closes the current TextWriter instance and releases any system resources associated with it.
[Note: After a call to System.IO.TextReader.Close , any operation on the current instance might throw an exception.This version of System.IO.TextReader.Close is equivalent to System.IO.TextReader.Dispose(System.Boolean)(
true
).]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
protected virtual void Dispose(bool disposing);
Releases the unmanaged resources used by the TextWriter and optionally releases the managed resources.
- disposing
true
to release both managed and unmanaged resources;false
to release only unmanaged resources.
When the disposing parameter istrue
, this method releases all resources held by any managed objects that this FileStream references. This method invokes theDispose()
method of each referenced object.[Note: System.IO.FileStream.Dispose(System.Boolean) may be called multiple times by other objects. When overriding System.IO.FileStream.Dispose(System.Boolean)(Boolean), be careful not to reference objects that have been previously disposed in an earlier call to System.IO.FileStream.Dispose(System.Boolean) .]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Flush();
Writes any buffered data to the underlying device and clears all buffers for the current TextWriter instance.
[Behaviors: As described above.]
[Default: This method is not implemented in this abstract class.]
System.IO.TextWriter Class, System.IO Namespace
public static TextWriter Synchronized(TextWriter writer);
Creates a thread-safe wrapper around the specified TextWriter instance.
- writer
- The TextWriter to synchronize.
A thread-safe TextWriter .
Exception Type Condition ArgumentNullException writer is null
.
This method returns a class that wraps around the specified TextWriter instance and restricts concurrent access to it by multiple threads.
System.IO.TextWriter Class, System.IO Namespace
void IDisposable.Dispose();
Implemented to support the IDisposable interface. [Note: For more information, see System.IDisposable.Dispose.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(string format, params object[] arg);
Writes a formatted string to the text stream.
- format
- A String containing the format string.
- arg
- The array of objects referenced from the format string.
Exception Type Condition ArgumentNullException format is null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to arg
.
Length .
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)(System.String.Format(System.String,System.Object) (format, arg)).[Note: If a specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(string format, object arg0, object arg1, object arg2);
Writes out a formatted string to the text stream.
- format
- A String containing the format string.
- arg0
- The first object referenced in the format string.
- arg1
- The second object referenced in the format string.
- arg2
- The third object referenced in the format string.
Exception Type Condition ArgumentNullException format is null
.-or-
An object referenced in the format string is
null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (3).
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)(System.String.Format(System.String,System.Object) (format, arg0, arg1, arg2)).[Note: If a specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(string format, object arg0, object arg1);
Writes out a formatted string to the text stream.
- format
- A String containing the format string.
- arg0
- The first object referenced in the format string.
- arg1
- The second object referenced in the format string.
Exception Type Condition ArgumentNullException format is null
.-or-
An object referenced in the format string is
null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (2).
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)(System.String.Format(System.String,System.Object) (format, arg0, arg1)).[Note: If a specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(string format, object arg0);
Writes out the format string to the text stream.
- format
- A String containing the format string.
- arg0
- An object referenced in the format string.
Exception Type Condition ArgumentNullException format is null
.-or-
An object referenced in the format string is
null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (1).
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)(System.String.Format(System.String,System.Object) (format, arg0)).[Note: If the specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(object value);
Writes the text representation of a specified object to the text stream.
- value
- The object to write. If value is
null
, nothing is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString()).[Behaviors: As described above.]
[Default: The default implementation uses the System.IO.TextWriter.Write(System.Char)(String) method.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(string value);
Writes a specified String to the text stream.
- value
- The String to write. If value is
null
, nothing is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)(value.ToByteArray()).[Note: This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine .]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(decimal value);
Writes the text representation of a specified Decimal to the text stream.
- value
- The Decimal to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString ()).[Behaviors: As described above.]
ExtendedNumerics
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(double value);
Writes the text representation of a specified Double to the text stream.
- value
- The Double to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString()).[Behaviors: As described above.]
ExtendedNumerics
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(float value);
Writes the text representation of a specified Single to the text stream.
- value
- The Single to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString()).[Behaviors: As described above.]
ExtendedNumerics
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(ulong value);
Writes the text representation of a specified UInt64 to the text stream.
- value
- The UInt64 to write.
Exception Type Condition IOException An I/O error occurred.
This member is not CLS-compliant. For a CLS-compliant alternative, use System.IO.TextWriter.Write(System.Char)(Decimal).This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.
ToString
() ).[Behaviors: As described above.]
CLSCompliantAttribute(false)
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(long value);
Writes the text representation of a specified Int64 to the text stream.
- value
- The Int64 to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString
() ).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(uint value);
Writes the text representation of a UInt32 to the text stream.
- value
- The UInt32 to write.
Exception Type Condition IOException An I/O error occurred.
This member is not CLS-compliant. For a CLS-compliant alternative, use System.IO.TextWriter.Write(System.Char)(Int64).This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString ()).
[Behaviors: As described above.]
CLSCompliantAttribute(false)
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(int value);
Writes the text representation of a specified Int32 to the text stream.
- value
- The Int32 to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString
()).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(bool value);
Writes the text representation of a specified Boolean value to the text stream.
- value
- The Boolean value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToString ()).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(char[] buffer, int index, int count);
Writes a subarray of characters to the text stream.
- buffer
- The character array from which characters are read.
- index
- Starting index in the buffer.
- count
- The number of characters to write.
Exception Type Condition ArgumentNullException buffer is null
.ArgumentException (index + count ) > buffer .
Length.ArgumentOutOfRangeException index < 0 or count < 0. IOException An I/O error occurred.
[Note: This method does not search the specified array for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.]
[Behaviors: As described above.]
[Default: The default implementation uses the System.IO.TextWriter.Write(System.Char)(
char
[]) method.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(char[] buffer);
Writes a character array to the text stream.
- buffer
- The Char array to write to the text stream. If buffer is
null
, nothing is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)(buffer, 0, buffer.Length ).[Note: This method does not search the specified array for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void Write(char value);
Writes a character to the text stream.
- value
- The Char to write to the text stream.
Exception Type Condition IOException An I/O error occurred.
[Behaviors: As described above.]
[Default: This method is not implemented in this abstract class.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(string format, params object[] arg);
Writes out a formatted string followed by a line terminator to the text stream.
- format
- A String containing the format string.
- arg
- The array of objects referenced from the format string.
Exception Type Condition ArgumentNullException format or arg is null
.IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to arg
.
Length.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine(System.String.Format(System.String,System.Object) (format, arg)).[Note: If the specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(string format, object arg0, object arg1, object arg2);
Writes out a formatted string followed by a line terminator to the text stream.
- format
- A String containing the format string.
- arg0
- The first object referenced in the format string.
- arg1
- The second object referenced in the format string.
- arg2
- The third object referenced in the format string.
Exception Type Condition ArgumentNullException format is null
.-or-
An object referenced in the format string is
null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (3).
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine(System.String.Format(System.String,System.Object) (format, arg0, arg1, arg2)).[Note: If the specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(string format, object arg0, object arg1);
Writes out a formatted string followed by a line terminator to the text stream.
- format
- A String containing the format string.
- arg0
- The first object referenced in the format string.
- arg1
- The second object referenced in the format string.
Exception Type Condition ArgumentNullException format is null
.-or-
An object referenced in the format string is
null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (2).
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine(System.String.Format(System.String,System.Object) (format, arg0, arg1)).[Note: If the specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(string format, object arg0);
Writes out a formatted string followed by a line terminator to the text stream.
- format
- A String containing the format string.
- arg0
- The object referenced in the format string.
Exception Type Condition ArgumentNullException format is null
.-or-
An object referenced in the format string is
null
.
IOException An I/O error occurred. FormatException The format specification in format is invalid. -or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (1).
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine(System.String.Format(System.String,System.Object) (format, arg0)).[Note: If the specified object is not referenced in the format string, it is ignored.
This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.
]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(object value);
Writes the text representation of a specified object followed by a line terminator to the text stream.
- value
- The object to write. If value is
null
, only the line terminator is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine( value.ToString() ).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(string value);
Writes a specified String followed by a line terminator to the text stream.
- value
- The String to write. If value is
null
, only the line terminator is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.Write(System.Char) is equivalent to System.IO.TextWriter.Write(System.Char)( value.ToByteArray() ).The line terminator string is defined by the System.IO.TextWriter.NewLine property.
[Note: This method does not search the specified String for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(decimal value);
Writes the text representation of a specified Decimal value followed by a line terminator to the text stream.
- value
- The Decimal value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine (value.ToString()).[Behaviors: As described above.]
ExtendedNumerics
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(double value);
Writes the text representation of a specified Double value followed by a line terminator to the text stream.
- value
- The Double value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine (value.ToString()).[Behaviors: As described above.]
ExtendedNumerics
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(float value);
Writes the text representation of a specified Single value followed by a line terminator to the text stream.
- value
- The Single value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine(value.ToString()).[Behaviors: As described above.]
ExtendedNumerics
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(ulong value);
Writes the text representation of a specified UInt64 value followed by a line terminator to the text stream.
- value
- The UInt64 value to write.
Exception Type Condition IOException An I/O error occurred.
This member is not CLS-compliant. For a CLS-compliant alternative, use System.IO.TextWriter.WriteLine(Decimal).This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine( value.ToString () ).
[Behaviors: As described above.]
CLSCompliantAttribute(false)
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(long value);
Writes the text representation of a specified Int64 value followed by a line terminator to the text stream.
- value
- The Int64 value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine( value.ToString
() ).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(uint value);
Writes the text representation of a specified UInt32 value followed by a line terminator to the text stream.
- value
- The UInt32 value to write.
Exception Type Condition IOException An I/O error occurred.
This member is not CLS-compliant. For a CLS-compliant alternative, use System.IO.TextWriter.WriteLine(Int64).This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine( value.ToString () ).
[Behaviors: As described above.]
CLSCompliantAttribute(false)
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(int value);
Writes the text representation of a specified Int32 value followed by a line terminator to the text stream.
- value
- The Int32 value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine(value.ToString()).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(bool value);
Writes the text representation of a Boolean value followed by a line terminator to the text stream.
- value
- The Boolean value to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.WriteLine( value.ToString () ).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(char[] buffer, int index, int count);
Writes a sub-array of characters from a specified character array, followed by a line terminator to the text stream.
- buffer
- The Char array from which characters are read.
- index
- A Int32 that specifies the index in buffer at which to begin reading.
- count
- A Int32 that specifies the maximum number of characters to write.
Exception Type Condition ArgumentNullException buffer is null
.ArgumentException (index + count ) > buffer. ArgumentOutOfRangeException index < 0 -or-
count < 0.
IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.Write(System.Char)( value, index, count ) followed by System.IO.TextWriter.WriteLine().[Note: This method does not search the specified array for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(char[] buffer);
Writes a specified character array followed by a line terminator to the text stream.
- buffer
- The Char array from which data is read. If buffer is
null
, only the line terminator is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.Write(System.Char)( value ) followed by System.IO.TextWriter.WriteLine().[Note: This method does not search the specified array for individual newline characters (hexadecimal 0x000a) and replace them with System.IO.TextWriter.NewLine.]
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine(char value);
Writes a specified character followed by a line terminator to the text stream.
- value
- The Char to write to the text stream.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.Write(System.Char)( value ) followed by System.IO.TextWriter.WriteLine().[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual void WriteLine();
Writes a line terminator to the text stream.
Exception Type Condition IOException An I/O error occurred.
This version of System.IO.TextWriter.WriteLine is equivalent to System.IO.TextWriter.Write(System.Char)(System.IO.TextWriter.NewLine.ToCharArray()).[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public static readonly TextWriter Null;
Provides a TextWriter object without a backing store.
Use System.IO.TextWriter.Null to redirect output to a stream that will not consume any operating system resources.When a System.IO.TextWriter.Write(System.Char) method is invoked on System.IO.TextWriter.Null, the call simply returns, and no data is actually written to any backing store.
System.IO.TextWriter Class, System.IO Namespace
public abstract Encoding Encoding { get; }
Gets the Encoding in which the output is written.
The Encoding in which the output is written.
[Behaviors: As described above.]
[Usage: This property is required in some XML scenarios where a header must be written containing the encoding used by the TextWriter. This allows XML code to consume an arbitrary TextWriter and generate a correct XML header.]
System.IO.TextWriter Class, System.IO Namespace
public virtual IFormatProvider FormatProvider { get; }
Gets an object that provides formatting for the current instance
A IFormatProvider object for a specific culture, or the formatting of the current culture if no other culture is specified.
[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace
public virtual string NewLine { get; set; }
Gets or sets the line terminator string used by the current TextWriter .
A String containing the line terminator string for the current TextWriter .
The default line terminator string is System.Environment.NewLine .The line terminator string is written to the text stream whenever one of the System.IO.TextWriter.WriteLine methods is called. In order for text written by the TextWriter to be readable by a TextReader , only "\n" or System.Environment.NewLine should be used as terminator strings. If System.IO.TextWriter.NewLine is set to
null
, the default newline character is used instead.[Behaviors: As described above.]
System.IO.TextWriter Class, System.IO Namespace