Home >Backend Development >C#.Net Tutorial >What is the System.Console class and its methods in C#?

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

WBOY
WBOYforward
2023-09-13 18:25:021515browse

C# 中的 System.Console 类及其方法是什么?

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

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

Reference: MSDN System Class Methods##1234##5MoveBufferArea(Int32,Int32,Int32,Int32,Int32,Int32, Char, ConsoleColor, ConsoleColor)6OpenStandardError()7OpenStandardError(Int32)8OpenStandardInput()9OpenStandardInput(Int32)10OpenStandardOutput()11OpenStandardOutput(Int32)12Read()13ReadKey()
Sr.No Methods and instructions
Beep()Play the beep sound through Console speakers.

Beep(Int32,Int32) Play the specified frequency through the console speaker and duration of the beep.

Clear()Clear the console buffer and corresponding console window display information.

Move buffer(Int32,Int32,Int32,Int32,Int32,Int32) p>Copy the specified source area of ​​the screen buffer to the specified destination area.

Copy the specified source area of ​​the screen buffer to the specified destination area.

Get the standard error stream.

Get the standard error stream, which is set to The specified buffer size.

Get the standard input stream.

Get the standard input stream, which is set to The specified buffer size.

td>

Get the standard output stream.

Get the standard output stream, which is set to The specified buffer size.

From the standard input stream Read the next character.

Get the next character or function pressed by the user key. The key pressed will be displayed in the console window.

The above is the detailed content of What is the System.Console class and its methods in C#?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete