Performing some action while waiting for a key to be pressed in .NET console applications
November 28, 2017 Leave a comment
You can wait for the user to press some button in a .NET console application using the Console.ReadKey() method. That’s simple and easy to use, but occasionally you might want to perform some action while waiting for the user to press a key.
The KeyAvailable property of the Console object helps you achieve just that.