.NET Framework Class Library
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.

Methods

  NameDescription
Public methodStatic memberBeepOverloaded. Plays the sound of a beep through the console speaker.
Public methodStatic memberClearClears the console buffer and corresponding console window of display information.
Public methodStatic memberMoveBufferAreaOverloaded. Copies a specified source area of the screen buffer to a specified destination area.
Public methodStatic memberOpenStandardErrorOverloaded. Acquires the standard error stream.
Public methodStatic memberOpenStandardInputOverloaded. Acquires the standard input stream.
Public methodStatic memberOpenStandardOutputOverloaded. Acquires the standard output stream.
Public methodStatic memberReadReads the next character from the standard input stream.
Public methodStatic memberReadKeyOverloaded. Obtains the next character or function key pressed by the user.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkReadLineReads the next line of characters from the standard input stream.
Public methodStatic memberResetColorSets the foreground and background console colors to their defaults.
Public methodStatic memberSetBufferSizeSets the height and width of the screen buffer area to the specified values.
Public methodStatic memberSetCursorPositionSets the position of the cursor.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkSetErrorSets the Error property to the specified TextWriter object.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkSetInSets the In property to the specified TextReader object.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkSetOutSets the Out property to the specified TextWriter object.
Public methodStatic memberSetWindowPositionSets the position of the console window relative to the screen buffer.
Public methodStatic memberSetWindowSizeSets the height and width of the console window to the specified values.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkWriteOverloaded. Writes the text representation of the specified value or values to the standard output stream.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkWriteLineOverloaded. Writes the specified data, followed by the current line terminator, to the standard output stream.
Top
Properties

  NameDescription
Public propertyStatic memberBackgroundColorGets or sets the background color of the console.
Public propertyStatic memberBufferHeightGets or sets the height of the buffer area.
Public propertyStatic memberBufferWidthGets or sets the width of the buffer area.
Public propertyStatic memberCapsLockGets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off.
Public propertyStatic memberCursorLeftGets or sets the column position of the cursor within the buffer area.
Public propertyStatic memberCursorSizeGets or sets the height of the cursor within a character cell.
Public propertyStatic memberCursorTopGets or sets the row position of the cursor within the buffer area.
Public propertyStatic memberCursorVisibleGets or sets a value indicating whether the cursor is visible.
Public propertyStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkErrorGets the standard error output stream.
Public propertyStatic memberForegroundColorGets or sets the foreground color of the console.
Public propertyStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkInGets the standard input stream.
Public propertyStatic memberInputEncodingGets or sets the encoding the console uses to read input.
Public propertyStatic memberKeyAvailableGets a value indicating whether a key press is available in the input stream.
Public propertyStatic memberLargestWindowHeightGets the largest possible number of console window rows, based on the current font and screen resolution.
Public propertyStatic memberLargestWindowWidthGets the largest possible number of console window columns, based on the current font and screen resolution.
Public propertyStatic memberNumberLockGets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off.
Public propertyStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkOutGets the standard output stream.
Public propertyStatic memberOutputEncodingGets or sets the encoding the console uses to write output.
Public propertyStatic memberTitleGets or sets the title to display in the console title bar.
Public propertyStatic memberTreatControlCAsInputGets 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 propertyStatic memberWindowHeightGets or sets the height of the console window area.
Public propertyStatic memberWindowLeftGets or sets the leftmost position of the console window area relative to the screen buffer.
Public propertyStatic memberWindowTopGets or sets the top position of the console window area relative to the screen buffer.
Public propertyStatic memberWindowWidthGets or sets the width of the console window.
Top
Events

  NameDescription
Public eventStatic memberCancelKeyPressOccurs when the Control modifier key (CTRL) and C console key (C) are pressed simultaneously (CTRL+C).
Top
See Also

Reference

Tags :


Page view tracker