![]() |
Press any key to continue...
When you write a console program in C#, after I read the output and I'm done looking at the output, I'd like the "Press any key to continue..." message to be displayed at the bottom, similar to the way it's displayed in Visual C++. But I don't know if this is possible. My experience so far has been that to close the console window, you must hit only the Enter key. Is there a way to close the window by hitting any key?
|
put this at the end, or where ever you want it to say "Press any key to continue..."
:
Console.WriteLine("Press any key to continue..."); |
Any key? Where is the any key?
|
Thanks. I will try it out. Can I ask though about the ReadKey()funtion? What does it do? Does it just read a keypress(any key) and then when the user presses any key the program will terminate? Does it return a true or false value to the program or something? If you could just provide a little explanation so I can understand and add some comments to my program. I'm the kind that wants to understand what every single line is doing.
|
Have you considered looking it up?
|
Quote:
|
If you are unsure about a certain function or method that you use in C# code, enter "whatevermethodname() in C#" in your favorite search engine and it should give you an accurate result.
Here's a link to see more resources for C#: http://msdn2.microsoft.com/en-us/lib...62(VS.80).aspx |
| All times are GMT -5. The time now is 12:43 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC