Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 16th, 2007, 1:11 AM   #1
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 189
Rep Power: 0 357mag is an unknown quantity at this point
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?
357mag is offline   Reply With Quote
Old May 16th, 2007, 1:28 AM   #2
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 664
Rep Power: 10 crawforddavid2006 is on a distinguished road
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
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();
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old May 16th, 2007, 9:38 AM   #3
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 426
Rep Power: 10 Wizard1988 is on a distinguished road
Any key? Where is the any key?
__________________

Wizard1988 is offline   Reply With Quote
Old May 16th, 2007, 3:55 PM   #4
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 189
Rep Power: 0 357mag is an unknown quantity at this point
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.
357mag is offline   Reply With Quote
Old May 16th, 2007, 4:22 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 8,368
Rep Power: 19 DaWei will become famous soon enoughDaWei will become famous soon enough
Have you considered looking it up?
__________________
Contributor's Corner:
Politically Incorrect
DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 16th, 2007, 4:37 PM   #6
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 664
Rep Power: 10 crawforddavid2006 is on a distinguished road
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Quote:
Originally Posted by 357mag View Post
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.
It waits until a key is pressed, and then moves on to the next step. It can also be used for char variables too if i'm not mistaken
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old May 16th, 2007, 5:10 PM   #7
ReggaetonKing
Pro
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: NJ
Posts: 894
Rep Power: 9 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
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!
ReggaetonKing is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware installation guide for Linux beginners coldDeath Coder's Corner Lounge 108 Jan 10th, 2013 9:51 AM
Francois Press frankish Show Off Your Open Source Projects 12 Jun 18th, 2006 5:12 PM
The Debug Utility darthsabbath Assembly 2 May 20th, 2006 5:12 PM
Simulating a Key press timethyfx JavaScript and Client-Side Browser Scripting 1 Jul 28th, 2005 7:03 AM
press any key to continue asddsa Java 11 Jun 19th, 2005 1:50 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC