using System;
namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            bool a = false;
            ConsoleKeyInfo keyInfo;
            while (!a)
            {
                if (System.Console.KeyAvailable)//如果有键按下
                {
                    keyInfo = System.Console.ReadKey(true);//读取
                    if (keyInfo.Key == ConsoleKey.Escape)//判断
                    {
                         a = true;
                    }
                     
                }              
            }
        }
      }
}

                    
                


    
                
            
        
浙公网安备 33010602011771号