Console.ReadKey
Console.ReadKey reads a single key press without waiting for Enter.
Console.Write("Press any key: ");var key = Console.ReadKey();Console.WriteLine($"\nYou pressed: {key.KeyChar}");Run the Application
Section titled “Run the Application”dotnet runResult (example pressing ‘A’)
Section titled “Result (example pressing ‘A’)”Press any key: AYou pressed: A