static void CancelDemo()
{
int i = 0;
//Console.WriteLine("Press ESC to stop");
//while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
//{
// Console.WriteLine(++i);
//}
Console.WriteLine("Enput any key to stop console output!");
while(!Console.KeyAvailable)
{
Console.WriteLine(++i);
}
}
static void CancelDemo()
{
int i = 0;
Console.WriteLine("Press ESC to stop");
while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
{
Console.WriteLine(++i);
}
}