Home c# The pressed key is displayed in the Console.ReadKey () method Visual Studio...

The pressed key is displayed in the Console.ReadKey () method Visual Studio 2019 C #

Author

Date

Category

When I use the Console.ReadKey () method; Pressed keys displays the console. How not to display?
(ex. When you click ConsoleKey.f, it is displayed ‘A’ in the console)


using System;
Using System.Collections.Genic;
Using System.Linq;
Using System.Text;
using system.threading.tasks;
Namespace Program
{
  Class Program
  {
    Static Void Main (String [] Args)
    {
      Console.ReadKey ();
    }
  }
}

Answer 1

Try

Console.ReadKey (True);

Determines whether the key is shown in the console window. True Do not display the key shroud; otherwise false.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions