C# 控制台程序按Esc键退出
while (true)
{
key = Console.ReadKey().Key;
if (key == ConsoleKey.Escape) break;
}
C# 控制台程序按Esc键退出
while (true)
{
key = Console.ReadKey().Key;
if (key == ConsoleKey.Escape) break;
}