Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

console app problem 1

Status
Not open for further replies.

RichieMac

Programmer
Aug 18, 2004
61
GB
Hello all,

A quick question that is probably something very simple.

I have a console app that when I run it the console never stays open for long enough for me to see the output. How do I set VS.net so that the console stays open until I close it.
 
Just do a Console.ReadLine(); at the end of your code! The window will stay open till you press a button!

 
Thanks for the help.

But isn't there some way of setting VS so that you don't have to add this line?
 
Sorry, I dont know of any setting that would accomplish this!
 
Ok I'll stick with this way for now. Thanks again.
 
As far as the .net runtime is concerned, when the program finishes execution, it's ok to close the window. You can see the same behavior by writing a short .cmd script, and double-clicking on it in explorer.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
When you're running your app from VS I think you can use CTRL-F5 to rebuild and start the application and that will keep the window open. If you just use F5 to rebuild and start the app then the window will close unless you add the Console.ReadLine() at the end of your code.

ud


tkc
 
Thanks digiduck. I was almost sure there was a way to do it I just didn't know how.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top