public sealed class Console
Object
Console
mscorlib
BCL
Represents the standard input, output, and error streams for console applications.
The Console class provides basic input and output support for applications that read from and write characters to the console. If the console does not exist, as in a GUI application, writing to the console produces no result, and no exception is raised.The standard input, output, and error streams are represented by properties, and are automatically associated with the console when the application starts. Applications can redirect these properties to other streams; for example, streams associated with files instead of the console. [Note: For additional information see the System.Console.SetIn(System.IO.TextReader), System.Console.SetOut(System.IO.TextWriter), and System.Console.SetError(System.IO.TextWriter) methods.]
By default, the read methods in this class use the standard input stream and the write methods use the standard output stream.
The write methods support writing data with or without automatically appending carriage return and linefeed characters. This enables the writing of strings, formatted strings, arrays of characters, instances of primitive types, and arbitrary objects without first having to convert them to strings.
This class uses synchronized TextReader and TextWriter instances. Multiple threads can concurrently read from and/or write to an instance of this type.
The following example demonstrates the use of basic Console input and output functions. The program waits for the user to enter a name.
using System; public class ConsoleTest { public static void Main() { Console.Write("Hello "); Console.WriteLine("World!"); Console.Write("What is your name: "); string name = Console.ReadLine(); Console.Write("Hello, "); Console.Write(name); Console.WriteLine("!"); } }The output for a user who entered the name "Fred" is
Hello World!
What is your name: Fred
Hello, Fred!
System Namespace
Console Methods
Console.OpenStandardError() Method
Console.OpenStandardError(int) Method
Console.OpenStandardInput() Method
Console.OpenStandardInput(int) Method
Console.OpenStandardOutput() Method
Console.OpenStandardOutput(int) Method
Console.Read Method
Console.ReadLine Method
Console.SetError Method
Console.SetIn Method
Console.SetOut Method
Console.Write(System.String, System.Object[]) Method
Console.Write(System.String, System.Object, System.Object, System.Object) Method
Console.Write(System.String, System.Object, System.Object) Method
Console.Write(System.String, System.Object) Method
Console.Write(bool) Method
Console.Write(char) Method
Console.Write(char[]) Method
Console.Write(char[], int, int) Method
Console.Write(double) Method
Console.Write(System.Decimal) Method
Console.Write(float) Method
Console.Write(int) Method
Console.Write(uint) Method
Console.Write(long) Method
Console.Write(ulong) Method
Console.Write(System.Object) Method
Console.Write(System.String) Method
Console.WriteLine(bool) Method
Console.WriteLine() Method
Console.WriteLine(System.String, System.Object[]) Method
Console.WriteLine(System.String, System.Object, System.Object, System.Object) Method
Console.WriteLine(System.String, System.Object, System.Object) Method
Console.WriteLine(System.String, System.Object) Method
Console.WriteLine(System.String) Method
Console.WriteLine(System.Object) Method
Console.WriteLine(ulong) Method
Console.WriteLine(long) Method
Console.WriteLine(uint) Method
Console.WriteLine(int) Method
Console.WriteLine(float) Method
Console.WriteLine(double) Method
Console.WriteLine(System.Decimal) Method
Console.WriteLine(char[], int, int) Method
Console.WriteLine(char[]) Method
Console.WriteLine(char) Method
Console Properties
Console.Error Property
Console.In Property
Console.Out Property
public static Stream OpenStandardError();
Returns the standard error stream.
A new synchronized Stream object that writes to the console.
System.Console Class, System Namespace
public static Stream OpenStandardError(int bufferSize);
Returns the standard error stream.
- bufferSize
- A Int32 that specifies the desired internal stream buffer size.
A new synchronized Stream object that writes to the console.
Buffering console streams is not required to be supported. If it is not supported, the bufferSize parameter is ignored, and this method behaves identically to System.Console.OpenStandardError(). If buffering is supported, the buffering behavior of the Console class is implementation-specific.
System.Console Class, System Namespace
public static Stream OpenStandardInput();
Returns the standard input stream.
A new synchronized Stream object that reads from the console.
System.Console Class, System Namespace
public static Stream OpenStandardInput(int bufferSize);
Returns the standard input stream.
- bufferSize
- A Int32 that specifies the desired internal stream buffer size.
A new synchronized Stream object that reads from the console.
Buffering console streams is not required to be supported. If it is not supported, the bufferSize parameter is ignored, and this method behaves identically to System.Console.OpenStandardInput(). If buffering is supported, the buffering behavior of the Console class is implementation-specific.
System.Console Class, System Namespace
public static Stream OpenStandardOutput();
Returns the standard output stream.
A new synchronized Stream object that writes to the console.
System.Console Class, System Namespace
public static Stream OpenStandardOutput(int bufferSize);
Returns the standard output stream. The desired size of the internal buffer for the stream is specified.
- bufferSize
- A Int32 that specifies the desired internal stream buffer size.
A new synchronized Stream object that writes to the console.
Buffering console streams is not required to be supported. If it is not supported, the bufferSize parameter is ignored, and this method behaves identically to System.Console.OpenStandardOutput(). If buffering is supported, the buffering behavior of the Console class is implementation-specific.
System.Console Class, System Namespace
public static int Read();
Reads the next character from the standard input stream.
The next character from the character source represented as a Int32 , or -1 if at the end of the stream.
Exception Type Condition IOException An I/O error occurred.
This method will not return until the read operation is terminated; for example, by the user pressing the enter key. If data is available, the input stream contains what the user entered, suffixed with the environment dependent newline character.
System.Console Class, System Namespace
public static string ReadLine();
Reads the next line of characters from the System.Console.InTextReader.
A String containing the next line from the input stream, ornull
if the end of the input stream has already been reached.
Exception Type Condition IOException An I/O error occurred. OutOfMemoryException There is insufficient memory to allocate a buffer for the returned string.
A line is defined as a sequence of characters followed by a carriage return (Unicode 0x000d), a line feed (Unicode 0x000a), or a System.Environment.NewLine. The returned string does not contain the terminating character(s).
System.Console Class, System Namespace
public static void SetError(TextWriter newError);
Sets the System.Console.Error property to the specified TextWriter .
- newError
- A TextWriter that becomes the new standard error output stream.
Exception Type Condition SecurityException The caller does not have the required permission. ArgumentNullException newError is null
.
This method replaces the System.Console.Error property with a synchronized TextWriter returned by System.IO.TextWriter.Synchronized(System.IO.TextWriter)( newError ).[Note: By default, the System.Console.Error property is set to the system's standard error stream.]
System.Console Class, System Namespace
public static void SetIn(TextReader newIn);
Sets the System.Console.In property to the specified TextReader .
- newIn
- A TextReader that becomes the new standard input stream.
Exception Type Condition ArgumentNullException newIn is null
.
This method replaces the System.Console.In property with a synchronized TextReader returned by System.IO.TextReader.Synchronized(System.IO.TextReader)( newIn ).[Note: By default, the System.Console.In property is set to the system's standard input stream.]
System.Console Class, System Namespace
public static void SetOut(TextWriter newOut);
Sets the System.Console.Out property to the specified TextWriter .
- newOut
- A TextWriter that becomes the new standard output stream.
Exception Type Condition ArgumentNullException newOut is null
.
This method replaces the System.Console.Out property with a synchronized TextWriter returned by System.IO.TextWriter.Synchronized(System.IO.TextWriter)( newOut ).[Note: By default, the System.Console.Out property is set to the system's standard output stream.]
System.Console Class, System Namespace
public static void Write(string format, params object[] arg);
Writes a formatted string to the System.Console.OutTextWriter .
- format
- A String that specifies the format string.
- arg
- An array of objects referenced in 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.
[Note: If a specified object is not referenced in format, it is ignored.For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void Write(string format, object arg0, object arg1, object arg2);
Writes a formatted string to the System.Console.OutTextWriter .
- format
- A String that specifies 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
.
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).
[Note: If a specified object is not referenced in the format string, it is ignored.]
[Note: For more information on format strings see the String class overview.]
System.Console Class, System Namespace
public static void Write(string format, object arg0, object arg1);
Writes a formatted string to the System.Console.OutTextWriter .
- format
- A String that specifies 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
.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).
[Note: If a specified object is not referenced in format, it is ignored.For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void Write(string format, object arg0);
Writes a formatted string to the System.Console.OutTextWriter .
- format
- A String that specifies the format string.
- arg0
- An object referenced in 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 the number of provided objects to be formatted (1).
[Note: If the specified object is not referenced in format, it is ignored.For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void Write(bool value);
Writes the text representation of a Boolean to the System.Console.OutTextWriter .
- value
- The Boolean to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( value.ToString () ).
System.Console Class, System Namespace
public static void Write(char value);
Writes a character to the System.Console.OutTextWriter .
- value
- The Unicode character to write to the text stream.
Exception Type Condition IOException An I/O error occurred.
System.Console Class, System Namespace
public static void Write(char[] buffer);
Writes a character array to the System.Console.OutTextWriter .
- buffer
- The Unicode character 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.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( buffer ).
System.Console Class, System Namespace
public static void Write(char[] buffer, int index, int count);
Writes a subarray of characters to the System.Console.OutTextWriter .
- buffer
- The Unicode character array from which characters are read.
- index
- A Int32 that specifies the starting offset in buffer at which to begin reading.
- count
- A Int32 that specifies the number of characters to write.
Exception Type Condition ArgumentException (index + count ) is greater than the length of buffer.
IOException An I/O error occurred. ArgumentOutOfRangeException index or count is negative. ArgumentNullException buffer is null
.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( buffer, index, count ).
System.Console Class, System Namespace
public static void Write(double value);
Writes the text representation of a specified Double to the System.Console.OutTextWriter .
- value
- The Double to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
(value.ToString()).
ExtendedNumerics
System.Console Class, System Namespace
public static void Write(decimal value);
Writes the text representation of a specified Decimal to the System.Console.OutTextWriter .
- value
- The Decimal to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
(value.ToString()).
ExtendedNumerics
System.Console Class, System Namespace
public static void Write(float value);
Writes the text representation of a specified Single to the System.Console.OutTextWriter .
- value
- The Single to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
(value .ToString()).
ExtendedNumerics
System.Console Class, System Namespace
public static void Write(int value);
Writes the text representation of a specified Int32 to the System.Console.OutTextWriter .
- value
- The Int32 to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( value.ToString()).
System.Console Class, System Namespace
public static void Write(uint value);
Writes the text representation of a specified UInt32 to the System.Console.OutTextWriter .
- 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.Console.Write(System.String,System.Object)(Int64).This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.
Write
( value.ToString
()).
CLSCompliantAttribute(false)
System.Console Class, System Namespace
public static void Write(long value);
Writes the text representation of a specified Int64 to the System.Console.OutTextWriter .
- value
- The Int64 to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( value.ToString() ).
System.Console Class, System Namespace
public static void Write(ulong value);
Writes the text representation of a specified UInt64 to the System.Console.OutTextWriter .
- 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.Console.Write(System.String,System.Object)(Decimal).This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.
Write
( value .ToString()).
CLSCompliantAttribute(false)
System.Console Class, System Namespace
public static void Write(object value);
Writes the text representation of a specified object to the System.Console.OutTextWriter .
- value
- The object to write. If value is
null
, System.String.Empty is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( value.ToString () ).[Note: If value is
null
, no exception is thrown and nothing is written. Otherwise, the object's System.Object.ToString method is called to produce the string representation, and the resulting string is written to the output stream.]
System.Console Class, System Namespace
public static void Write(string value);
Writes a specified string to the System.Console.OutTextWriter .
- value
- The String to write. If value is
null
, the System.String.Empty string is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.Write(System.String,System.Object) is equivalent to System.Console.Out.Write
( value ).[Note: If specified value is
null
, nothing is written to the output stream.]
System.Console Class, System Namespace
public static void WriteLine(bool value);
Writes the text representation of a Boolean followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Boolean to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( value.ToString() ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine();
Writes a line terminator to the System.Console.OutTextWriter .
Exception Type Condition IOException An I/O error occurred.
The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(string format, params object[] arg);
Writes a formatted string and a new line to the System.Console.OutTextWriter .
- format
- A String that specifies the format string.
- arg
- An array of objects referenced in 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 .
The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.[Note: If a specified object is not referenced in format, it is ignored.
For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void WriteLine(string format, object arg0, object arg1, object arg2);
Writes a formatted string and a new line to the System.Console.OutTextWriter .
- format
- A String that specifies 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
.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).
The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.[Note: If a specified object is not referenced in format, it is ignored.
For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void WriteLine(string format, object arg0, object arg1);
Writes a formatted string and a new line to the System.Console.OutTextWriter .
- format
- A String that specifies 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
.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).
The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.[Note: If a specified object is not referenced in format, it is ignored.
For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void WriteLine(string format, object arg0);
Writes a formatted string and a line terminator to the System.Console.OutTextWriter.
- format
- A String that specifies the format string.
- arg0
- An object referenced in 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 the number of provided objects to be formatted (1).
The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.[Note: If the specified object is not referenced in format, it is ignored.
For more information on format strings, see the String class overview.
]
System.Console Class, System Namespace
public static void WriteLine(string value);
Writes a specified String followed by a line terminator to the System.Console.OutTextWriter .
- 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.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( value ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(object value);
Writes the text representation of a specified object followed by a line terminator to the System.Console.OutTextWriter .
- 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.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( value.ToString() ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(ulong value);
Writes the text representation of a specified UInt64 followed by a line terminator to the System.Console.OutTextWriter .
- 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.Console.WriteLine(Decimal).This version of System.Console.WriteLine is equivalent to System.Console.Out.
WriteLine
( value .ToString()).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
CLSCompliantAttribute(false)
System.Console Class, System Namespace
public static void WriteLine(long value);
Writes the text representation of a specified Int64 followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Int64 to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( value.ToString() ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(uint value);
Writes the text representation of a specified UInt32 followed by a line terminator to the System.Console.OutTextWriter .
- 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.Console.WriteLine(Int64).This version of System.Console.WriteLine is equivalent to System.Console.Out.
WriteLine
( value.ToString() ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
CLSCompliantAttribute(false)
System.Console Class, System Namespace
public static void WriteLine(int value);
Writes the text representation of a specified Int32 followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Int32 to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( value .ToString ()).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(float value);
Writes the text representation of a specified Single followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Single to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
(value.ToString ()).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
ExtendedNumerics
System.Console Class, System Namespace
public static void WriteLine(double value);
Writes the text representation of a specified Double followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Double to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
(value.ToString ()).The default line terminator is the value of theSystem.Environment.NewLine property. The line terminator can be set using theSystem.IO.TextWriter.NewLine property of the System.Console.Out stream.
ExtendedNumerics
System.Console Class, System Namespace
public static void WriteLine(decimal value);
Writes the text representation of a specified Decimal followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Decimal to write.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
(value.ToString ()).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
ExtendedNumerics
System.Console Class, System Namespace
public static void WriteLine(char[] buffer, int index, int count);
Writes a subarray of characters followed by a line terminator to the System.Console.OutTextWriter .
- buffer
- The Unicode character array from which data is read.
- index
- A Int32 that specifies the index into buffer at which to begin reading.
- count
- A Int32 that specifies the number of characters to write.
Exception Type Condition ArgumentException (index + count ) is greater than the length of buffer.
IOException An I/O error occurred. ArgumentOutOfRangeException index or count is negative. ArgumentNullException buffer is null
.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( buffer, index, count ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(char[] buffer);
Writes an array of characters followed by a line terminator to the System.Console.OutTextWriter .
- buffer
- The Unicode character array to write. If buffer is
null
, only the line terminator is written.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( buffer ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static void WriteLine(char value);
Writes a character followed by a line terminator to the System.Console.OutTextWriter .
- value
- The Unicode character to write to the text stream.
Exception Type Condition IOException An I/O error occurred.
This version of System.Console.WriteLine is equivalent to System.Console.Out.WriteLine
( value ).The default line terminator is the value of the System.Environment.NewLine property. The line terminator can be set using the System.IO.TextWriter.NewLine property of the System.Console.Out stream.
System.Console Class, System Namespace
public static TextWriter Error { get; }
Gets the system's standard error output stream.
A synchronized TextWriter object where error output is sent.
This property is read-only.This property can be redirected using the System.Console.SetError(System.IO.TextWriter) method.
[Note: If the application does not have a Console, System.Console.Error behaves like System.IO.TextWriter.Null. ]
System.Console Class, System Namespace
public static TextReader In { get; }
Gets the system's standard input stream.
A synchronized TextReader object from which user input is received.
This property is read-only.This property can be redirected using the System.Console.SetIn(System.IO.TextReader) method.
[Note: If the application does not have a Console, System.Console.In behaves like System.IO.TextReader.Null. ]
System.Console Class, System Namespace
public static TextWriter Out { get; }
Gets the system's standard output stream.
A synchronized TextWriter object where normal output is sent.
This property is read-only.This property can be redirected using the System.Console.SetOut(System.IO.TextWriter) method.
[Note: If the application does not have a Console, System.Console.Out behaves like System.IO.TextWriter.Null. ]
System.Console Class, System Namespace