System.Console Describes the console key that was pressed, including the character represented by the console key and the state of the SHIFT, ALT, and CTRL modifier keys. Initializes a new instance of the structure using the specified character, console key, and modifier keys. The Unicode character that corresponds to the key parameter. The console key that corresponds to the keyChar parameter. to indicate that a SHIFT key was pressed; otherwise, . to indicate that an ALT key was pressed; otherwise, . to indicate that a CTRL key was pressed; otherwise, . The numeric value of the key parameter is less than 0 or greater than 255. Gets a value indicating whether the specified object is equal to the current object. An object to compare to the current object. if obj is equal to the current object; otherwise, . Gets a value indicating whether the specified object is equal to the current object. An object to compare to the current object. if value is a object and is equal to the current object; otherwise, . Returns the hash code for the current object. A 32-bit signed integer hash code. Gets the console key represented by the current object. A value that identifies the console key that was pressed. Gets the Unicode character represented by the current object. An object that corresponds to the console key represented by the current object. Gets a bitwise combination of values that specifies one or more modifier keys pressed simultaneously with the console key. A bitwise combination of the enumeration values. There is no default value. Indicates whether the specified objects are equal. The first object to compare. The second object to compare. if a is equal to b; otherwise, . Indicates whether the specified objects are not equal. The first object to compare. The second object to compare. if a is not equal to b; otherwise, . Specifies the standard keys on a console. The A key. The Add key (the addition key on the numeric keypad). The Application key (Microsoft Natural Keyboard). The ATTN key. The B key. The BACKSPACE key. The Browser Back key (Windows 2000 or later). The Browser Favorites key (Windows 2000 or later). The Browser Forward key (Windows 2000 or later). The Browser Home key (Windows 2000 or later). The Browser Refresh key (Windows 2000 or later). The Browser Search key (Windows 2000 or later). The Browser Stop key (Windows 2000 or later). The C key. The CLEAR key. The CRSEL (CURSOR SELECT) key. The D key. The 0 key. The 1 key. The 2 key. The 3 key. The 4 key. The 5 key. The 6 key. The 7 key. The 8 key. The 9 key. The Decimal key (the decimal key on the numeric keypad). The DEL (DELETE) key. The Divide key (the division key on the numeric keypad). The DOWN ARROW key. The E key. The END key. The ENTER key. The ERASE EOF key. The ESC (ESCAPE) key. The EXECUTE key. The EXSEL (EXTEND SELECTION) key. The F key. The F1 key. The F10 key. The F11 key. The F12 key. The F13 key. The F14 key. The F15 key. The F16 key. The F17 key. The F18 key. The F19 key. The F2 key. The F20 key. The F21 key. The F22 key. The F23 key. The F24 key. The F3 key. The F4 key. The F5 key. The F6 key. The F7 key. The F8 key. The F9 key. The G key. The H key. The HELP key. The HOME key. The I key. The INS (INSERT) key. The J key. The K key. The L key. The Start Application 1 key (Microsoft Natural Keyboard, Windows 2000 or later). The Start Application 2 key (Microsoft Natural Keyboard, Windows 2000 or later). The Start Mail key (Microsoft Natural Keyboard, Windows 2000 or later). The Select Media key (Microsoft Natural Keyboard, Windows 2000 or later). The LEFT ARROW key. The left Windows logo key (Microsoft Natural Keyboard). The M key. The Media Next Track key (Windows 2000 or later). The Media Play/Pause key (Windows 2000 or later). The Media Previous Track key (Windows 2000 or later). The Media Stop key (Windows 2000 or later). The Multiply key (the multiplication key on the numeric keypad). The N key. A constant reserved for future use. The 0 key on the numeric keypad. The 1 key on the numeric keypad. The 2 key on the numeric keypad. The 3 key on the numeric keypad. The 4 key on the numeric keypad. The 5 key on the numeric keypad. The 6 key on the numeric keypad. The 7 key on the numeric keypad. The 8 key on the numeric keypad. The 9 key on the numeric keypad. The O key. The OEM 1 key (OEM specific). The OEM 102 key (OEM specific). The OEM 2 key (OEM specific). The OEM 3 key (OEM specific). The OEM 4 key (OEM specific). The OEM 5 (OEM specific). The OEM 6 key (OEM specific). The OEM 7 key (OEM specific). The OEM 8 key (OEM specific). The CLEAR key (OEM specific). The OEM Comma key on any country/region keyboard (Windows 2000 or later). The OEM Minus key on any country/region keyboard (Windows 2000 or later). The OEM Period key on any country/region keyboard (Windows 2000 or later). The OEM Plus key on any country/region keyboard (Windows 2000 or later). The P key. The PA1 key. The PACKET key (used to pass Unicode characters with keystrokes). The PAGE DOWN key. The PAGE UP key. The PAUSE key. The PLAY key. The PRINT key. The PRINT SCREEN key. The IME PROCESS key. The Q key. The R key. The RIGHT ARROW key. The right Windows logo key (Microsoft Natural Keyboard). The S key. The SELECT key. The Separator key. The Computer Sleep key. The SPACEBAR key. The Subtract key (the subtraction key on the numeric keypad). The T key. The TAB key. The U key. The UP ARROW key. The V key. The Volume Down key (Microsoft Natural Keyboard, Windows 2000 or later). The Volume Mute key (Microsoft Natural Keyboard, Windows 2000 or later). The Volume Up key (Microsoft Natural Keyboard, Windows 2000 or later). The W key. The X key. The Y key. The Z key. The ZOOM key. Specifies constants that define foreground and background colors for the console. 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. Represents the method that will handle the event of a . The source of the event. A object that contains the event data. Provides data for the event. This class cannot be inherited. 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 , which terminates the current process. if the current process should resume when the event handler concludes; if the current process should terminate. The default value is ; the current process terminates when the event handler returns. If , the current process continues. 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. Represents the standard input, output, and error streams for console applications. This class cannot be inherited. 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. Plays the sound of a beep through the console speaker. This method was executed on a server, such as SQL Server, that does not permit access to a user interface. Plays the sound of a beep of a specified frequency and duration through the console speaker. The frequency of the beep, ranging from 37 to 32767 hertz. The duration of the beep measured in milliseconds. frequency is less than 37 or more than 32767 hertz. -or- duration is less than or equal to zero. This method was executed on a server, such as SQL Server, that does not permit access to the console. Gets or sets the height of the buffer area. The current height, in rows, of the buffer area. The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to . -or- The value in a set operation is less than + . The user does not have permission to perform this action. An I/O error occurred. Gets or sets the width of the buffer area. The current width, in columns, of the buffer area. The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to . -or- The value in a set operation is less than + . The user does not have permission to perform this action. An I/O error occurred. Occurs when the modifier key (Ctrl) and either the console key (C) or the Break key are pressed simultaneously (Ctrl+C or Ctrl+Break). Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off. if CAPS LOCK is turned on; if CAPS LOCK is turned off. Clears the console buffer and corresponding console window of display information. An I/O error occurred. Gets or sets the column position of the cursor within the buffer area. The current position, in columns, of the cursor. The value in a set operation is less than zero. -or- The value in a set operation is greater than or equal to . The user does not have permission to perform this action. An I/O error occurred. Gets or sets the height of the cursor within a character cell. The size of the cursor expressed as a percentage of the height of a character cell. The property value ranges from 1 to 100. The value specified in a set operation is less than 1 or greater than 100. The user does not have permission to perform this action. An I/O error occurred. Gets or sets the row position of the cursor within the buffer area. The current position, in rows, of the cursor. The value in a set operation is less than zero. -or- The value in a set operation is greater than or equal to . The user does not have permission to perform this action. An I/O error occurred. Gets or sets a value indicating whether the cursor is visible. if the cursor is visible; otherwise, . The user does not have permission to perform this action. An I/O error occurred. Gets the standard error output stream. A that represents the standard error output stream. 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. Gets the standard input stream. A that represents the standard input stream. Gets or sets the encoding the console uses to read input. The encoding used to read console input. The property value in a set operation is . An error occurred during the execution of this operation. Your application does not have permission to perform this operation. Gets a value that indicates whether the error output stream has been redirected from the standard error stream. if error output is redirected; otherwise, . Gets a value that indicates whether input has been redirected from the standard input stream. if input is redirected; otherwise, . Gets a value that indicates whether output has been redirected from the standard output stream. if output is redirected; otherwise, . Gets a value indicating whether a key press is available in the input stream. if a key press is available; otherwise, . An I/O error occurred. Standard input is redirected to a file instead of the keyboard. Gets the largest possible number of console window rows, based on the current font and screen resolution. The height of the largest possible console window measured in rows. Gets the largest possible number of console window columns, based on the current font and screen resolution. The width of the largest possible console window measured in columns. Copies a specified source area of the screen buffer to a specified destination area. The leftmost column of the source area. The topmost row of the source area. The number of columns in the source area. The number of rows in the source area. The leftmost column of the destination area. The topmost row of the destination area. One or more of the parameters is less than zero. -or- sourceLeft or targetLeft is greater than or equal to . -or- sourceTop or targetTop is greater than or equal to . -or- sourceTop + sourceHeight is greater than or equal to . -or- sourceLeft + sourceWidth is greater than or equal to . The user does not have permission to perform this action. An I/O error occurred. Copies a specified source area of the screen buffer to a specified destination area. The leftmost column of the source area. The topmost row of the source area. The number of columns in the source area. The number of rows in the source area. The leftmost column of the destination area. The topmost row of the destination area. The character used to fill the source area. The foreground color used to fill the source area. The background color used to fill the source area. One or more of the parameters is less than zero. -or- sourceLeft or targetLeft is greater than or equal to . -or- sourceTop or targetTop is greater than or equal to . -or- sourceTop + sourceHeight is greater than or equal to . -or- sourceLeft + sourceWidth is greater than or equal to . One or both of the color parameters is not a member of the enumeration. The user does not have permission to perform this action. An I/O error occurred. Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off. if NUM LOCK is turned on; if NUM LOCK is turned off. Acquires the standard error stream. The standard error stream. Acquires the standard error stream, which is set to a specified buffer size. The internal stream buffer size. The standard error stream. bufferSize is less than or equal to zero. Acquires the standard input stream. The standard input stream. Acquires the standard input stream, which is set to a specified buffer size. The internal stream buffer size. The standard input stream. bufferSize is less than or equal to zero. Acquires the standard output stream. The standard output stream. Acquires the standard output stream, which is set to a specified buffer size. The internal stream buffer size. The standard output stream. bufferSize is less than or equal to zero. Gets the standard output stream. A that represents the standard output stream. Gets or sets the encoding the console uses to write output. The encoding used to write console output. The property value in a set operation is . An error occurred during the execution of this operation. Your application does not have permission to perform this operation. 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. Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window. An object that describes the constant and Unicode character, if any, that correspond to the pressed console key. The object also describes, in a bitwise combination of values, whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key. The property is redirected from some stream other than the console. Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window. Determines whether to display the pressed key in the console window. to not display the pressed key; otherwise, . An object that describes the constant and Unicode character, if any, that correspond to the pressed console key. The object also describes, in a bitwise combination of values, whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key. The property is redirected from some stream other than the console. Reads the next line of characters from the standard input stream. The next line of characters from the input stream, or 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 . 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. Sets the height and width of the screen buffer area to the specified values. The width of the buffer area measured in columns. The height of the buffer area measured in rows. height or width is less than or equal to zero. -or- height or width is greater than or equal to . -or- width is less than + . -or- height is less than + . The user does not have permission to perform this action. An I/O error occurred. Sets the position of the cursor. The column position of the cursor. Columns are numbered from left to right starting at 0. The row position of the cursor. Rows are numbered from top to bottom starting at 0. left or top is less than zero. -or- left is greater than or equal to . -or- top is greater than or equal to . The user does not have permission to perform this action. An I/O error occurred. Sets the property to the specified object. A stream that is the new standard error output. newError is . The caller does not have the required permission. Sets the property to the specified object. A stream that is the new standard input. newIn is . The caller does not have the required permission. Sets the property to the specified object. A stream that is the new standard output. newOut is . The caller does not have the required permission. Sets the position of the console window relative to the screen buffer. The column position of the upper left corner of the console window. The row position of the upper left corner of the console window. left or top is less than zero. -or- left + is greater than . -or- top + is greater than . The user does not have permission to perform this action. An I/O error occurred. Sets the height and width of the console window to the specified values. The width of the console window measured in columns. The height of the console window measured in rows. width or height is less than or equal to zero. -or- width plus or height plus is greater than or equal to . -or- width or height is greater than the largest possible window width or height for the current screen resolution and console font. The user does not have permission to perform this action. An I/O error occurred. Gets or sets the title to display in the console title bar. The string to be displayed in the title bar of the console. The maximum length of the title string is 24500 characters. In a get operation, the retrieved title is longer than 24500 characters. In a set operation, the specified title is longer than 24500 characters. In a set operation, the specified title is . An I/O error occurred. Gets or sets a value indicating whether the combination of the modifier key and console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system. if Ctrl+C is treated as ordinary input; otherwise, . Unable to get or set the input mode of the console input buffer. Gets or sets the height of the console window area. The height of the console window measured in rows. The value of the property or the value of the property is less than or equal to 0. -or- The value of the property plus the value of the property is greater than or equal to . -or- The value of the property or the value of the property is greater than the largest possible window width or height for the current screen resolution and console font. Error reading or writing information. Gets or sets the leftmost position of the console window area relative to the screen buffer. The leftmost console window position measured in columns. In a set operation, the value to be assigned is less than zero. -or- As a result of the assignment, plus would exceed . Error reading or writing information. Gets or sets the top position of the console window area relative to the screen buffer. The uppermost console window position measured in rows. In a set operation, the value to be assigned is less than zero. -or- As a result of the assignment, plus would exceed . Error reading or writing information. Gets or sets the width of the console window. The width of the console window measured in columns. The value of the property or the value of the property is less than or equal to 0. -or- The value of the property plus the value of the property is greater than or equal to . -or- The value of the property or the value of the property is greater than the largest possible window width or height for the current screen resolution and console font. Error reading or writing information. Writes the text representation of the specified objects to the standard output stream using the specified format information. A composite format string. The first object to write using format. The second object to write using format. The third object to write using format. An I/O error occurred. format is . The format specification in format is invalid. Writes the text representation of the specified objects to the standard output stream using the specified format information. A composite format string. The first object to write using format. The second object to write using format. An I/O error occurred. format is . The format specification in format is invalid. Writes the text representation of the specified array of objects to the standard output stream using the specified format information. A composite format string. An array of objects to write using format. An I/O error occurred. format or arg is . The format specification in format is invalid. Writes the text representation of the specified object to the standard output stream using the specified format information. A composite format string. An object to write using format. An I/O error occurred. format is . The format specification in format is invalid. 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. 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. Writes the specified string value to the standard output stream. The value to write. An I/O error occurred. Writes the specified subarray of Unicode characters to the standard output stream. An array of Unicode characters. The starting position in buffer. The number of characters to write. buffer is . index or count is less than zero. index plus count specify a position that is not within buffer. An I/O error occurred. Writes the text representation of the specified object to the standard output stream. The value to write, or . An I/O error occurred. 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. Writes the specified Unicode character value to the standard output stream. The value to write. An I/O error occurred. Writes the specified array of Unicode characters to the standard output stream. A Unicode character array. An I/O error occurred. Writes the text representation of the specified Boolean value to the standard output stream. The value to write. An I/O error occurred. 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. 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. 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. Writes the text representation of the specified value to the standard output stream. The value to write. An I/O error occurred. 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. The first object to write using format. The second object to write using format. An I/O error occurred. format is . The format specification in format is invalid. 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. 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 buffer. The number of characters to write. buffer is . index or count is less than zero. index plus count specify a position that is not within buffer. An I/O error occurred. 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. An array of objects to write using format. An I/O error occurred. format or arg is . The format specification in format is invalid. 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. An object to write using format. An I/O error occurred. format is . The format specification in format is invalid. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. Writes the current line terminator to the standard output stream. An I/O error occurred. 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. The first object to write using format. The second object to write using format. The third object to write using format. An I/O error occurred. format is . The format specification in format is invalid. 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. Specifies combinations of modifier and console keys that can interrupt the current process. The modifier key plus the BREAK console key. The modifier key plus the console key. Represents the SHIFT, ALT, and CTRL modifier keys on a keyboard. The left or right ALT modifier key. The left or right CTRL modifier key. The left or right SHIFT modifier key.