How can I continue processing in a vb.net console application until I press a key? I basically want to loop playing a beep every half second until the user presses any key. I have the loop and beeping down:
Do Until <key is pressed>
Console.Beep()
Sleep(500)
Loop
The question is, how do I implement the “<key is pressed>” condition?
Look at this simple example to create a simple program for making a typewriter like stuff.
you can make a infinite loop as all beginners do when they create some little console games in C.
just make a exit statement that let your program to break the flow.
simply a Escape key pressed
you can follow the Tariqulazam comment link that may help you implement in .net.
try to use this method Beep(int, int). follow on this link.
http://msdn.microsoft.com/en-us/library/4fe3hdb1.aspx
The Beep method is not supported on the 64-bit editions of Windows Vista and Windows XP.