public static void Main(String[] args)
{
bool tag = true;
do
{
ConsoleKeyInfo info = Console.ReadKey();
switch (info.Key)
{
case ConsoleKey.E:
Console.WriteLine("exit");
tag = false;
break;
case ConsoleKey.UpArrow:
Console.WriteLine("Up");
break;
case ConsoleKey.DownArrow:
Console.WriteLine("Down");
break;
case ConsoleKey.LeftArrow:
Console.WriteLine("Left");
break;
case ConsoleKey.RightArrow:
Console.WriteLine("Right");
break;
default:
Console.WriteLine(info.Key);
break;
}
} while (tag);
Console.Read();
}

相关文章:

  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-11-08
  • 2021-11-30
  • 2021-05-25
猜你喜欢
  • 2022-12-23
  • 2021-06-14
  • 2021-12-13
  • 2021-10-20
  • 2022-12-23
  • 2021-05-04
  • 2021-09-13
相关资源
相似解决方案