Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

The Console type exposes the following members.

Properties

  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.
Gets a value indicating whether the CAPS LOCK keyboard toggle is
CapsLock
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.
Gets a value indicating whether a key press is available in the input
KeyAvailable
stream.
Gets the largest possible number of console window rows, based on the
LargestWindowHeight
current font and screen resolution.
Gets the largest possible number of console window columns, based on
LargestWindowWidth
the current font and screen resolution.
Gets a value indicating whether the NUM LOCK keyboard toggle is
NumberLock
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.
Gets or sets a value indicating whether the combination of the Control
TreatControlCAsInput 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.
Gets or sets the leftmost position of the console window area relative to
WindowLeft
the screen buffer.
Gets or sets the top position of the console window area relative to the
WindowTop
screen buffer.
WindowWidth Gets or sets the width of the console window.
Top
Methods

  Name Description
Plays the sound of a beep through the console
Beep()
speaker.
Plays the sound of a beep of a specified frequency
Beep(Int32, Int32)
and duration through the console speaker.
Clears the console buffer and corresponding console
Clear
window of display information.
MoveBufferArea(Int32, Int32, Int32, Copies a specified source area of the screen buffer to
Int32, Int32, Int32) a specified destination area.
MoveBufferArea(Int32, Int32, Int32,
Copies a specified source area of the screen buffer to
Int32, Int32, Int32, Char, ConsoleColor,
a specified destination area.
ConsoleColor)
OpenStandardError() Acquires the standard error stream.
Acquires the standard error stream, which is set to a
OpenStandardError(Int32)
specified buffer size.
OpenStandardInput() Acquires the standard input stream.
Acquires the standard input stream, which is set to a
OpenStandardInput(Int32)
specified buffer size.
OpenStandardOutput() Acquires the standard output stream.
Acquires the standard output stream, which is set to a
OpenStandardOutput(Int32)
specified buffer size.
Reads the next character from the standard input
Read
stream.
Obtains the next character or function key pressed by
ReadKey() the user. The pressed key is displayed in the console
window.
Obtains the next character or function key pressed by
ReadKey(Boolean) the user. The pressed key is optionally displayed in
the console window.
Reads the next line of characters from the standard
ReadLine
input stream.
Sets the foreground and background console colors to
ResetColor
their defaults.
Sets the height and width of the screen buffer area to
SetBufferSize
the specified values.
SetCursorPosition Sets the position of the cursor.
Sets the Error property to the specified TextWriter
SetError
object.
Sets the In property to the specified TextReader
SetIn
object.
Sets the Out property to the specified TextWriter
SetOut
object.
Sets the position of the console window relative to
SetWindowPosition
the screen buffer.
Sets the height and width of the console window to
SetWindowSize
the specified values.
Write(Boolean) Writes the text representation of the specified
Boolean value to the standard output stream.
Writes the specified Unicode character value to the
Write(Char)
standard output stream.
Writes the specified array of Unicode characters to
Write(Char[])
the standard output stream.
Writes the text representation of the specified
Write(Decimal)
Decimal value to the standard output stream.
Writes the text representation of the specified double-
Write(Double) precision floating-point value to the standard output
stream.
Writes the text representation of the specified 32-bit
Write(Int32)
signed integer value to the standard output stream.
Writes the text representation of the specified 64-bit
Write(Int64)
signed integer value to the standard output stream.
Writes the text representation of the specified object
Write(Object)
to the standard output stream.
Writes the text representation of the specified single-
Write(Single) precision floating-point value to the standard output
stream.
Writes the specified string value to the standard
Write(String)
output stream.
Writes the text representation of the specified 32-bit
Write(UInt32)
unsigned integer value to the standard output stream.
Writes the text representation of the specified 64-bit
Write(UInt64)
unsigned integer value to the standard output stream.
Writes the text representation of the specified object
Write(String, Object) to the standard output stream using the specified
format information.
Writes the text representation of the specified array of
Write(String, Object[]) objects to the standard output stream using the
specified format information.
Writes the specified subarray of Unicode characters
Write(Char[], Int32, Int32)
to the standard output stream.
Writes the text representation of the specified objects
Write(String, Object, Object) to the standard output stream using the specified
format information.
Writes the text representation of the specified objects
Write(String, Object, Object, Object) to the standard output stream using the specified
format information.
Writes the text representation of the specified objects
Write(String, Object, Object, Object,
and variable-length parameter list to the standard
Object)
output stream using the specified format information.
Writes the current line terminator to the standard
WriteLine()
output stream.
Writes the text representation of the specified
WriteLine(Boolean) Boolean value, followed by the current line
terminator, to the standard output stream.
Writes the specified Unicode character, followed by
WriteLine(Char) the current line terminator, value to the standard
output stream.
Writes the specified array of Unicode characters,
WriteLine(Char[]) followed by the current line terminator, to the
standard output stream.
Writes the text representation of the specified
WriteLine(Decimal) Decimal value, followed by the current line
terminator, to the standard output stream.
Writes the text representation of the specified double-
WriteLine(Double) precision floating-point value, followed by the
current line terminator, to the standard output stream.
Writes the text representation of the specified 32-bit
WriteLine(Int32) signed integer value, followed by the current line
terminator, to the standard output stream.
Writes the text representation of the specified 64-bit
WriteLine(Int64) signed integer value, followed by the current line
terminator, to the standard output stream.
Writes the text representation of the specified object,
WriteLine(Object) followed by the current line terminator, to the
standard output stream.
Writes the text representation of the specified single-
WriteLine(Single) precision floating-point value, followed by the
current line terminator, to the standard output stream.
Writes the specified string value, followed by the
WriteLine(String)
current line terminator, to the standard output stream.
Writes the text representation of the specified 32-bit
WriteLine(UInt32) unsigned integer value, followed by the current line
terminator, to the standard output stream.
Writes the text representation of the specified 64-bit
WriteLine(UInt64) unsigned integer value, followed by the current line
terminator, to the standard output stream.
Writes the text representation of the specified object,
followed by the current line terminator, to the
WriteLine(String, Object)
standard output stream using the specified format
information.
Writes the text representation of the specified array of
objects, followed by the current line terminator, to the
WriteLine(String, Object[])
standard output stream using the specified format
information.
WriteLine(Char[], Int32, Int32) Writes the specified subarray of Unicode characters,
followed by the current line terminator, to the
standard output stream.
Writes the text representation of the specified objects,
followed by the current line terminator, to the
WriteLine(String, Object, Object)
standard output stream using the specified format
information.
Writes the text representation of the specified objects,
followed by the current line terminator, to the
WriteLine(String, Object, Object, Object)
standard output stream using the specified format
information.
Writes the text representation of the specified objects
WriteLine(String, Object, Object, Object, and variable-length parameter list, followed by the
Object) current line terminator, to the standard output stream
using the specified format information.
Top
Events

  Name Description
Occurs when the Control modifier key (CTRL) and C console key (C) are
CancelKeyPress
pressed simultaneously (CTRL+C)

You might also like