Console Members

Represents the standard input, output, and error streams for console applications. This class cannot be inherited.

The Console type exposes the following members.

  NameDescription
Public method Static member Beep Overloaded. Plays the sound of a beep through the console speaker.
Public method Static member Clear Clears the console buffer and corresponding console window of display information.
Public method Static member MoveBufferArea Overloaded. Copies a specified source area of the screen buffer to a specified destination area.
Public method Static member OpenStandardError Overloaded. Acquires the standard error stream.
Public method Static member OpenStandardInput Overloaded. Acquires the standard input stream.
Public method Static member OpenStandardOutput Overloaded. Acquires the standard output stream.
Public method Static member Read Reads the next character from the standard input stream.
Public method Static member ReadKey Overloaded. Obtains the next character or function key pressed by the user.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework ReadLine Reads the next line of characters from the standard input stream.
Public method Static member ResetColor Sets the foreground and background console colors to their defaults.
Public method Static member SetBufferSize Sets the height and width of the screen buffer area to the specified values.
Public method Static member SetCursorPosition Sets the position of the cursor.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework SetError Sets the Error property to the specified TextWriter object.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework SetIn Sets the In property to the specified TextReader object.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework SetOut Sets the Out property to the specified TextWriter object.
Public method Static member SetWindowPosition Sets the position of the console window relative to the screen buffer.
Public method Static member SetWindowSize Sets the height and width of the console window to the specified values.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework Write Overloaded. Writes the text representation of the specified value or values to the standard output stream.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework WriteLine Overloaded. Writes the specified data, followed by the current line terminator, to the standard output stream.
Top

  NameDescription
Public property Static member BackgroundColor Gets or sets the background color of the console.
Public property Static member BufferHeight Gets or sets the height of the buffer area.
Public property Static member BufferWidth Gets or sets the width of the buffer area.
Public property Static member CapsLock Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off.
Public property Static member CursorLeft Gets or sets the column position of the cursor within the buffer area.
Public property Static member CursorSize Gets or sets the height of the cursor within a character cell.
Public property Static member CursorTop Gets or sets the row position of the cursor within the buffer area.
Public property Static member CursorVisible Gets or sets a value indicating whether the cursor is visible.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework Error Gets the standard error output stream.
Public property Static member ForegroundColor Gets or sets the foreground color of the console.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework In Gets the standard input stream.
Public property Static member InputEncoding Gets or sets the encoding the console uses to read input.
Public property Static member KeyAvailable Gets a value indicating whether a key press is available in the input stream.
Public property Static member LargestWindowHeight Gets the largest possible number of console window rows, based on the current font and screen resolution.
Public property Static member LargestWindowWidth Gets the largest possible number of console window columns, based on the current font and screen resolution.
Public property Static member NumberLock Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework Out Gets the standard output stream.
Public property Static member OutputEncoding Gets or sets the encoding the console uses to write output.
Public property Static member Title Gets or sets the title to display in the console title bar.
Public property Static member 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.
Public property Static member WindowHeight Gets or sets the height of the console window area.
Public property Static member WindowLeft Gets or sets the leftmost position of the console window area relative to the screen buffer.
Public property Static member WindowTop Gets or sets the top position of the console window area relative to the screen buffer.
Public property Static member WindowWidth Gets or sets the width of the console window.
Top

  NameDescription
Public event Static member CancelKeyPress Occurs when the Control modifier key (CTRL) and C console key (C) are pressed simultaneously (CTRL+C).
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft