![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 148
Rep Power: 4
![]() |
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?
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
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...");
Console.ReadKey();
__________________
|
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: Oct 2005
Location: Chitown
Posts: 422
Rep Power: 4
![]() |
Any key? Where is the any key?
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 148
Rep Power: 4
![]() |
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.
|
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Have you considered looking it up?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#6 | |
|
Expert Programmer
|
Quote:
__________________
|
|
|
|
|
|
|
#7 |
|
Sexy Programmer
|
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
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Slackware installation guide for Linux beginners | coldDeath | Coder's Corner Lounge | 104 | Jul 29th, 2007 5:40 AM |
| Francois Press | frankish | Show Off Your Open Source Projects | 12 | Jun 18th, 2006 6:12 PM |
| The Debug Utility | darthsabbath | Assembly | 2 | May 20th, 2006 6:12 PM |
| Simulating a Key press | timethyfx | JavaScript and Client-Side Browser Scripting | 1 | Jul 28th, 2005 8:03 AM |
| press any key to continue | asddsa | Java | 11 | Jun 19th, 2005 2:50 PM |