What is the System.Console class and its methods in C#?



The System.Console class in C# represents the standard input, output, and error streams for console applications.

The following are some of the methods of the System.Console class −

Refer: MSDN System Class methods

Sr.No Method & Description
1 Beep()
Plays the sound of a beep through the console speaker.
2 Beep(Int32,Int32)
Plays the sound of a beep of a specified frequency and duration through the console speaker.
3 Clear()
Clears the console buffer and corresponding console window of display information.
4 MoveBufferArea(Int32,Int32,Int32,Int32,Int32,Int32)
Copies a specified source area of the screen buffer to a specified destination area.
5 MoveBufferArea(Int32,Int32,Int32,Int32,Int32,Int32, Char, ConsoleColor, ConsoleColor)
Copies a specified source area of the screen buffer to a specified destination area.
6 OpenStandardError()
Acquires the standard error stream.
7 OpenStandardError(Int32)
Acquires the standard error stream, which is set to a specified buffer size.
8 OpenStandardInput()
Acquires the standard input stream.
9 OpenStandardInput(Int32)
Acquires the standard input stream, which is set to a specified buffer size.
10 OpenStandardOutput()
Acquires the standard output stream.
11 OpenStandardOutput(Int32)
Acquires the standard output stream, which is set to a specified buffer size.
12 Read()
Reads the next character from the standard input stream.
13 ReadKey()
Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window.
Updated on: 2020-06-22T07:29:16+05:30

843 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements