Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Using Readline() and ReadKey() Simultaneously
  2. while ((line = Console.ReadLine()) != "x")
  3. {    
  4.     if (line == "BLABLA")
  5.     {
  6.         //Stuff
  7.     }
  8.  
  9.     else
  10.     {
  11.         //Stuff
  12.     }
  13.  
  14.     ConsoleKeyInfo ki = Console.ReadKey(true);
  15.     if ((ki.Key == ConsoleKey.V) && (ki.Modifiers == ConsoleModifiers.Control))
  16.     {
  17.         //Stuff
  18.     }
  19. }