|
-
February 13th, 2005, 05:30 AM
#1
check for console input
I was wondering how can I get the same effect of kbhit() from C/C++ in a C# console based application, i.e. do something (like stop the application) the moment a key was pressed?
I have created this console based app, with this observer pattern: I have a clock subject with a timer that periodically updates its observers which display the time in the console. The thing is I want to stop it the moment I press a key, any key (and I don't want to use Ctrl+C ).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|