BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 This type is safe for multithreaded operations. System.Object

Represents the standard input, output, and error streams for console applications.

The 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. For additional information see the , , and 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 and instances. Multiple threads can concurrently read from and/or write to an instance of this type.

The following example demonstrates the use of basic 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!

- Property
  System.ConsoleColor To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Event
  System.ConsoleCancelEventHandler To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added. To be added.
- Method
  System.Void To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added. To be added.
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Boolean To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.IO.TextWriter

  Gets the system's standard error output stream.

  A synchronized object where error output is sent.

  This property is read-only.

  This property can be redirected using the method.

  If the application does not have a , behaves like .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.ConsoleColor To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.IO.TextReader

  Gets the system's standard input stream.

  A synchronized object from which user input is received.

  This property is read-only.

  This property can be redirected using the method.

  If the application does not have a , behaves like .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Text.Encoding To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Boolean To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added. To be added.
- Method
  System.Void `` `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` `` `` `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added. To be added.
- Method
  System.IO.Stream

  Returns the standard error stream.

  A new synchronized object that writes to the console.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.IO.Stream `` A that specifies the desired internal stream buffer size.

  Returns the standard error stream.

  A new synchronized object that writes to the console.

  Buffering console streams is not required to be supported. If it is not supported, the parameter is ignored, and this method behaves identically to (). If buffering is supported, the buffering behavior of the class is implementation-specific.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.IO.Stream

  Returns the standard input stream.

  A new synchronized object that reads from the console.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.IO.Stream `` A that specifies the desired internal stream buffer size.

  Returns the standard input stream.

  A new synchronized object that reads from the console.

  Buffering console streams is not required to be supported. If it is not supported, the parameter is ignored, and this method behaves identically to (). If buffering is supported, the buffering behavior of the class is implementation-specific.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.IO.Stream

  Returns the standard output stream.

  A new synchronized object that writes to the console.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.IO.Stream `` A that specifies the desired internal stream buffer size.

  Returns the standard output stream. The desired size of the internal buffer for the stream is specified.

  A new synchronized object that writes to the console.

  Buffering console streams is not required to be supported. If it is not supported, the parameter is ignored, and this method behaves identically to (). If buffering is supported, the buffering behavior of the class is implementation-specific.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.IO.TextWriter

  Gets the system's standard output stream.

  A synchronized object where normal output is sent.

  This property is read-only.

  This property can be redirected using the method.

  If the application does not have a , behaves like .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Text.Encoding To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Int32

  Reads the next character from the standard input stream.

  The next character from the character source represented as a , or -1 if at the end of the stream.

  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.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.ConsoleKeyInfo To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.ConsoleKeyInfo `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.String

  Reads the next line of characters from the .

  A containing the next line from the input stream, or if the end of the input stream has already been reached.

  A line is defined as a sequence of characters followed by a carriage return (Unicode 0x000d), a line feed (Unicode 0x000a), or a . The returned string does not contain the terminating character(s).

  An I/O error occurred. There is insufficient memory to allocate a buffer for the returned string. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` A that becomes the new standard error output stream.

  Sets the property to the specified .

  This method replaces the property with a synchronized returned by ( ).

  By default, the property is set to the system's standard error stream.

  The caller does not have the required permission. is . Requires permission. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` A that becomes the new standard input stream.

  Sets the property to the specified .

  This method replaces the property with a synchronized returned by ( ).

  By default, the property is set to the system's standard input stream.

  is . Requires permission to execute unmanaged code. See . 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` A that becomes the new standard output stream.

  Sets the property to the specified .

  This method replaces the property with a synchronized returned by ( ).

  By default, the property is set to the system's standard output stream.

  is . Requires permission to execute unmanaged code. See . 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.String To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Boolean To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a to the .

  This version of is equivalent to .( .ToString () ).

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The Unicode character to write to the text stream.

  Writes a character to the .

  To be added. An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The Unicode character array to write to the text stream. If is , nothing is written.

  Writes a character array to the .

  This version of is equivalent to .( ).

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the .

  This version of is equivalent to .(.ToString()).

  An I/O error occurred. 1 ExtendedNumerics 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the .

  This version of is equivalent to .(.ToString()).

  An I/O error occurred. 1 ExtendedNumerics 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the .

  This version of is equivalent to .( .ToString()).

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the .

  This version of is equivalent to .( .ToString() ).

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The object to write. If is , is written.

  Writes the text representation of a specified object to the .

  This version of is equivalent to .( .ToString () ).

  If is , no exception is thrown and nothing is written. Otherwise, the object's method is called to produce the string representation, and the resulting string is written to the output stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the .

  This version of is equivalent to .( .ToString()).

  An I/O error occurred. 1 ExtendedNumerics 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write. If is , the string is written.

  Writes a specified string to the .

  This version of is equivalent to .( ).

  If specified value is , nothing is written to the output stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the .

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  This version of is equivalent to .( . ()).

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0 System.CLSCompliant(false)
- Method
  System.Void `` The to write.

  Writes the text representation of a specified to the

  .

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  This version of is equivalent to .( .ToString()).

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0 System.CLSCompliant(false)
- Method
  System.Void `` `` A that specifies the format string. An object referenced in the format string.

  Writes a formatted string to the .

  If the specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  is . An I/O error occurred.

  The format specification in 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).

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `System.ParamArray` A that specifies the format string. An array of objects referenced in the format string.

  Writes a formatted string to the .

  If a specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  or is .

  An I/O error occurred.

  The format specification in is invalid.

  -or-

  The number indicating an argument to be formatted is less than zero, or greater than or equal to .Length.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `` `` The Unicode character array from which characters are read. A that specifies the starting offset in at which to begin reading. A that specifies the number of characters to write.

  Writes a subarray of characters to the .

  This version of is equivalent to .( , , ).

  ( + ) is greater than the length of .

  An I/O error occurred. or is negative. is . 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` `` A that specifies the format string. The first object referenced in the format string. The second object referenced in the format string.

  Writes a formatted string to the .

  If a specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  is . An I/O error occurred.

  The format specification in 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).

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `` `` `` A that specifies the format string. The first object referenced in the format string. The second object referenced in the format string. The third object referenced in the format string.

  Writes a formatted string to the .

  If a specified object is not referenced in the format string, it is ignored.

  For more information on format strings see the class overview.

  is .

  An I/O error occurred.

  The format specification in 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).

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0 System.CLSCompliant(false)
- Method
  System.Void

  Writes a line terminator to the .

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a followed by a line terminator to the .

  This version of is equivalent to .( .ToString() ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The Unicode character to write to the text stream.

  Writes a character followed by a line terminator to the .

  This version of is equivalent to .( ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The Unicode character array to write.

  Writes an array of characters followed by a line terminator to the .

  This version of is equivalent to .( ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. is . 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This version of is equivalent to .(.ToString ()).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 1 ExtendedNumerics 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This version of is equivalent to .(.ToString ()).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 1 ExtendedNumerics 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This version of is equivalent to .( .ToString ()).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This version of is equivalent to .( .ToString() ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The object to write. If is , only the line terminator is written.

  Writes the text representation of a specified object followed by a line terminator to the .

  This version of is equivalent to .( .ToString() ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This version of is equivalent to .(.ToString ()).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 1 ExtendedNumerics 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write. If is , only the line terminator is written.

  Writes a specified followed by a line terminator to the .

  This version of is equivalent to .( ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  This version of is equivalent to .( .ToString() ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0 System.CLSCompliant(false)
- Method
  System.Void `` The to write.

  Writes the text representation of a specified followed by a line terminator to the .

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  This version of is equivalent to .( .ToString()).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  An I/O error occurred. 0 1.0.5000.0 2.0.0.0 4.0.0.0 System.CLSCompliant(false)
- Method
  System.Void `` `` A that specifies the format string. An object referenced in the format string.

  Writes a formatted string and a line terminator to the .

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  If the specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  is . An I/O error occurred.

  The format specification in 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).

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `System.ParamArray` A that specifies the format string. An array of objects referenced in the format string.

  Writes a formatted string and a new line to the .

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  If a specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  or is .

  An I/O error occurred.

  The format specification in is invalid.

  -or-

  The number indicating an argument to be formatted is less than zero, or greater than or equal to .Length .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `` `` The Unicode character array from which data is read. A that specifies the index into at which to begin reading. A that specifies the number of characters to write.

  Writes a subarray of characters followed by a line terminator to the .

  This version of is equivalent to .( , , ).

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  ( + ) is greater than the length of .

  An I/O error occurred. or is negative. is . 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` `` A that specifies the format string. The first object referenced in the format string. The second object referenced in the format string.

  Writes a formatted string and a new line to the .

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  If a specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  is . An I/O error occurred.

  The format specification in 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).

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `` `` `` A that specifies the format string. The first object referenced in the format string. The second object referenced in the format string. The third object referenced in the format string.

  Writes a formatted string and a new line to the .

  The default line terminator is the value of the property. The line terminator can be set using the property of the stream.

  If a specified object is not referenced in , it is ignored.

  For more information on format strings, see the class overview.

  is . An I/O error occurred.

  The format specification in 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).

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0 System.CLSCompliant(false)
0