System.Console
Represents the standard input, output, and error streams for console applications. This class cannot be inherited.To browse the .NET Framework source code for this type, see the Reference Source.
1
Gets or sets the background color of the console.
A value that specifies the background color of the console; that is, the color that appears behind each character. The default is black.
The color specified in a set operation is not a valid member of .
The user does not have permission to perform this action.
An I/O error occurred.
1
Occurs when the modifier key (Ctrl) and either the console key (C) or the Break key are pressed simultaneously (Ctrl+C or Ctrl+Break).
1
Gets the standard error output stream.
A that represents the standard error output stream.
1
Gets or sets the foreground color of the console.
A that specifies the foreground color of the console; that is, the color of each character that is displayed. The default is gray.
The color specified in a set operation is not a valid member of .
The user does not have permission to perform this action.
An I/O error occurred.
1
Gets the standard input stream.
A that represents the standard input stream.
1
Acquires the standard error stream.
The standard error stream.
1
Acquires the standard input stream.
The standard input stream.
1
Acquires the standard output stream.
The standard output stream.
1
Gets the standard output stream.
A that represents the standard output stream.
1
Reads the next character from the standard input stream.
The next character from the input stream, or negative one (-1) if there are currently no more characters to be read.
An I/O error occurred.
1
Reads the next line of characters from the standard input stream.
The next line of characters from the input stream, or null if no more lines are available.
An I/O error occurred.
There is insufficient memory to allocate a buffer for the returned string.
The number of characters in the next line of characters is greater than .
1
Sets the foreground and background console colors to their defaults.
The user does not have permission to perform this action.
An I/O error occurred.
1
Sets the property to the specified object.
A stream that is the new standard error output.
is null.
The caller does not have the required permission.
1
Sets the property to the specified object.
A stream that is the new standard input.
is null.
The caller does not have the required permission.
1
Sets the property to the specified object.
A stream that is the new standard output.
is null.
The caller does not have the required permission.
1
Writes the text representation of the specified Boolean value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the specified Unicode character value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the specified array of Unicode characters to the standard output stream.
A Unicode character array.
An I/O error occurred.
1
Writes the specified subarray of Unicode characters to the standard output stream.
An array of Unicode characters.
The starting position in .
The number of characters to write.
is null.
or is less than zero.
plus specify a position that is not within .
An I/O error occurred.
1
Writes the text representation of the specified value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified double-precision floating-point value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified 32-bit signed integer value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified 64-bit signed integer value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified object to the standard output stream.
The value to write, or null.
An I/O error occurred.
1
Writes the text representation of the specified single-precision floating-point value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the specified string value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified object to the standard output stream using the specified format information.
A composite format string (see Remarks).
An object to write using .
An I/O error occurred.
is null.
The format specification in is invalid.
1
Writes the text representation of the specified objects to the standard output stream using the specified format information.
A composite format string (see Remarks).
The first object to write using .
The second object to write using .
An I/O error occurred.
is null.
The format specification in is invalid.
1
Writes the text representation of the specified objects to the standard output stream using the specified format information.
A composite format string (see Remarks).
The first object to write using .
The second object to write using .
The third object to write using .
An I/O error occurred.
is null.
The format specification in is invalid.
1
Writes the text representation of the specified array of objects to the standard output stream using the specified format information.
A composite format string (see Remarks).
An array of objects to write using .
An I/O error occurred.
or is null.
The format specification in is invalid.
1
Writes the text representation of the specified 32-bit unsigned integer value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified 64-bit unsigned integer value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the current line terminator to the standard output stream.
An I/O error occurred.
1
Writes the text representation of the specified Boolean value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the specified Unicode character, followed by the current line terminator, value to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the specified array of Unicode characters, followed by the current line terminator, to the standard output stream.
A Unicode character array.
An I/O error occurred.
1
Writes the specified subarray of Unicode characters, followed by the current line terminator, to the standard output stream.
An array of Unicode characters.
The starting position in .
The number of characters to write.
is null.
or is less than zero.
plus specify a position that is not within .
An I/O error occurred.
1
Writes the text representation of the specified value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified double-precision floating-point value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified 32-bit signed integer value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified 64-bit signed integer value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified single-precision floating-point value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the specified string value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream using the specified format information.
A composite format string (see Remarks).
An object to write using .
An I/O error occurred.
is null.
The format specification in is invalid.
1
Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
A composite format string (see Remarks).
The first object to write using .
The second object to write using .
An I/O error occurred.
is null.
The format specification in is invalid.
1
Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
A composite format string (see Remarks).
The first object to write using .
The second object to write using .
The third object to write using .
An I/O error occurred.
is null.
The format specification in is invalid.
1
Writes the text representation of the specified array of objects, followed by the current line terminator, to the standard output stream using the specified format information.
A composite format string (see Remarks).
An array of objects to write using .
An I/O error occurred.
or is null.
The format specification in is invalid.
1
Writes the text representation of the specified 32-bit unsigned integer value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Writes the text representation of the specified 64-bit unsigned integer value, followed by the current line terminator, to the standard output stream.
The value to write.
An I/O error occurred.
1
Provides data for the event. This class cannot be inherited.
2
Gets or sets a value that indicates whether simultaneously pressing the modifier key and the console key (Ctrl+C) or the Ctrl+Break keys terminates the current process. The default is false, which terminates the current process.
true if the current process should resume when the event handler concludes; false if the current process should terminate. The default value is false; the current process terminates when the event handler returns. If true, the current process continues.
2
Gets the combination of modifier and console keys that interrupted the current process.
One of the enumeration values that specifies the key combination that interrupted the current process. There is no default value.
1
Represents the method that will handle the event of a .
The source of the event.
A object that contains the event data.
2
Specifies constants that define foreground and background colors for the console.
2
The color black.
The color blue.
The color cyan (blue-green).
The color dark blue.
The color dark cyan (dark blue-green).
The color dark gray.
The color dark green.
The color dark magenta (dark purplish-red).
The color dark red.
The color dark yellow (ochre).
The color gray.
The color green.
The color magenta (purplish-red).
The color red.
The color white.
The color yellow.
Specifies combinations of modifier and console keys that can interrupt the current process.
1
The modifier key plus the BREAK console key.
The modifier key plus the console key.