Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Console.WriteLine("Press u0022Enteru0022 to play!");
- int num = 0;
- void WaitForKey(ConsoleKey key)
- {
- while (Console.ReadKey(true).Key != key)
- {
- }
- }
- for (int i = 1; i <= 10; i++)
- {
- WaitForKey(ConsoleKey.Enter);
- Console.Write("{0}", num);
- num++;
- }
- }
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- TextWriter OutSt = Console.Out;
- while (1 == 1)
- {
- Console.SetOut(TextWriter.Null);
- ConsoleKeyInfo KeyInfo = Console.ReadKey();
- if (KeyInfo.Modifiers == ConsoleModifiers.Control & KeyInfo.Key == ConsoleKey.E) { Console.SetOut(OutSt); Console.WriteLine("Print string"); };
- if (KeyInfo.Modifiers == ConsoleModifiers.Alt & KeyInfo.Key == ConsoleKey.E) { break; };
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement