Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide Console.ReadKey() user input?

I'm making a Fahrenheit to Celsius converter (a very simple one, because I'm very new) and when I use Console.ReadKey() it displays the character the user pressed to the screen. Is there a way to hide the user input?

cki = Console.ReadKey();
like image 412
Coder Shmoder Avatar asked Dec 04 '22 04:12

Coder Shmoder


1 Answers

There is an overload ReadKey(bool) which determines whether or not to hide the character. So you want:

cki = Console.ReadKey(true);
like image 128
clcto Avatar answered Dec 19 '22 11:12

clcto