Console.ReadLine()替代方案

Ari*_*Ari 1 c# console key

我有以下控制台应用程序:

private static bool run = false;

static void Main(string[] args)
{
    int choice = 0;  

    while (!run) 
    {
        Console.WriteLine("\n\t\t Press '1', '2' or '3' to continue");

        choice = int.Parse(Console.ReadLine());

        switch (choice)
        {
            case 1:
                {
                    Console.Clear();
                    Console.WriteLine("\n\t\t you pressed 1");
                }
            case 2:
                {
                    Console.Clear();
                    Console.WriteLine("\n\t\t you pressed 2");
                }
            case 3:
                {
                    Console.Clear();
                    Console.WriteLine("\n\t\t you pressed 3");
                }
            default:
                {
                    Console.Clear();
                    Console.WriteLine("\n\t\t Invalid key");
                    break;
                }
        }
    }

    Console.ReadLine();
}
Run Code Online (Sandbox Code Playgroud)

但是,使用此代码:

choice = int.Parse(Console.ReadLine()); 
Run Code Online (Sandbox Code Playgroud)

我希望这样,当用户按下1键或2或3时,立即执行相应的代码,而不是在按下所需的键后按下回车键.有哪些替代方案?

非常感谢任何帮助/指导/提示,谢谢

H.B*_*.B. 12

那怎么样ReadKey