有什麼方法同時檢測的ReadLine和ReadKey,因此,在大多數情況下,它表現爲一個readline的,除應檢測一些特殊的鍵輸入?使用的Readline()和ReadKey()同時
我需要一些「水貨」實施引進同時發生。 下面的代碼是同步的,不符合我的需要
while ((line = Console.ReadLine()) != "x")
{
if (line == "BLABLA")
{
//Stuff
}
else
{
//Stuff
}
ConsoleKeyInfo ki = Console.ReadKey(true);
if ((ki.Key == ConsoleKey.V) && (ki.Modifiers == ConsoleModifiers.Control))
{
//Stuff
}
}
可能重複http://stackoverflow.com/questions/5891538/c-sharp-listen-for-key-press-in-console-app – Alex 2012-01-09 14:45:05