Press any key to continue

Results 1 to 2 of 2

Thread: Press any key to continue

  1. #1
    Join Date
    Dec 1969

    Default Press any key to continue

    Hi -<BR><BR> My question is a simple one, however I cannot find any answer on the web, which leads me to believe it may not be as simple as I think. <BR><BR>Anyhow the Question is for a console application. How do I implement functionality to keep the console running until the user enters any key.....AND.....I mean any key not just the return key :-(<BR><BR>Seriuosly, I see that the following line will work for the return key but I want the console to close for any key press.<BR><BR> ...<BR> Console.Write("
    Press any key to continue:");<BR> Console.Read();<BR> ...<BR><BR>Any ideas appreciated<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Press any key to continue

    Console.Read() does not return until the enter key is pressed. Just like when normally typing at the command prompt.<BR><BR>Check the member available to you, you&#039;ll probably have to create your own stream reader if you *really* want to do it that way (although that is not typical for terminal based programs).<BR><BR>Read more about the Console class:<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts