Console Members
.NET Framework 3.0
Represents the standard input, output, and error streams for console applications. This class cannot be inherited.
The following tables list the members exposed by the Console type.
| Name | Description | |
|---|---|---|
| BackgroundColor | Gets or sets the background color of the console. |
| BufferHeight | Gets or sets the height of the buffer area. |
| BufferWidth | Gets or sets the width of the buffer area. |
| CapsLock | Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off. |
| CursorLeft | Gets or sets the column position of the cursor within the buffer area. |
| CursorSize | Gets or sets the height of the cursor within a character cell. |
| CursorTop | Gets or sets the row position of the cursor within the buffer area. |
| CursorVisible | Gets or sets a value indicating whether the cursor is visible. |
| Error | Gets the standard error output stream. |
| ForegroundColor | Gets or sets the foreground color of the console. |
| In | Gets the standard input stream. |
| InputEncoding | Gets or sets the encoding the console uses to read input. |
| KeyAvailable | Gets a value indicating whether a key press is available in the input stream. |
| LargestWindowHeight | Gets the largest possible number of console window rows, based on the current font and screen resolution. |
| LargestWindowWidth | Gets the largest possible number of console window columns, based on the current font and screen resolution. |
| NumberLock | Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off. |
| Out | Gets the standard output stream. |
| OutputEncoding | Gets or sets the encoding the console uses to write output. |
| Title | Gets or sets the title to display in the console title bar. |
| TreatControlCAsInput | Gets or sets a value indicating whether the combination of the Control modifier key and C console key (CTRL+C) is treated as ordinary input or as an interruption that is handled by the operating system. |
| WindowHeight | Gets or sets the height of the console window area. |
| WindowLeft | Gets or sets the leftmost position of the console window area relative to the screen buffer. |
| WindowTop | Gets or sets the top position of the console window area relative to the screen buffer. |
| WindowWidth | Gets or sets the width of the console window. |
| Name | Description | |
|---|---|---|
| Beep | Overloaded. Plays the sound of a beep through the console speaker. |
| Clear | Clears the console buffer and corresponding console window of display information. |
| Equals | Overloaded. Determines whether two Object instances are equal. (inherited from Object) |
| GetHashCode | Serves as a hash function for a particular type. (inherited from Object) |
| GetType | Gets the Type of the current instance. (inherited from Object) |
| MoveBufferArea | Overloaded. Copies a specified source area of the screen buffer to a specified destination area. |
| OpenStandardError | Overloaded. Acquires the standard error stream. |
| OpenStandardInput | Overloaded. Acquires the standard input stream. |
| OpenStandardOutput | Overloaded. Acquires the standard output stream. |
| Read | Reads the next character from the standard input stream. |
| ReadKey | Overloaded. Obtains the next character or function key pressed by the user. |
| ReadLine | Reads the next line of characters from the standard input stream. |
| ReferenceEquals | Determines whether the specified Object instances are the same instance. (inherited from Object) |
| ResetColor | Sets the foreground and background console colors to their defaults. |
| SetBufferSize | Sets the height and width of the screen buffer area to the specified values. |
| SetCursorPosition | Sets the position of the cursor. |
| SetError | Sets the Error property to the specified TextWriter object. |
| SetIn | Sets the In property to the specified TextReader object. |
| SetOut | Sets the Out property to the specified TextWriter object. |
| SetWindowPosition | Sets the position of the console window relative to the screen buffer. |
| SetWindowSize | Sets the height and width of the console window to the specified values. |
| ToString | Returns a String that represents the current Object. (inherited from Object) |
| Write | Overloaded. Writes the text representation of the specified value or values to the standard output stream. |
| WriteLine | Overloaded. Writes the specified data, followed by the current line terminator, to the standard output stream. |
| Name | Description | |
|---|---|---|
| CancelKeyPress | Occurs when the Control modifier key (CTRL) and C console key (C) are pressed simultaneously (CTRL+C). |