PDA

View Full Version : C#, kbhit & getch


BobLewiston
01-09-2009, 02:04 AM
In C#, what methods take the place of the old kbhit and getch functions in C? (I'm writing a console application in Visual Studio.)

ralph l mayo
01-09-2009, 02:48 AM
System.Console.In gets you a TextReader (http://msdn.microsoft.com/en-us/library/system.io.textreader_members.aspx) (a stream) of the console input, which has methods with similar uses to the functions you mention, particularly Peek() and the argument-less version of Read()