Title: Pause Output From a Command Line Application in .NET Debug Mode Post by: Taruna on December 27, 2006, 01:04:33 AM If you are writing a command line application in .NET, you might notice that the application closes immediately if you haven't set a breakpoint. This recipe shows you the one line method to keep the application open so you can see the output.
Typically when you are writing to the console, you use the Console.Write() method, but there is also a Read method to go along with it. If you place this line of code in your application, it will pause and wait for a keystroke before continuing: Code: Console.ReadLine(); If you are using Visual Basic instead of C#, just omit the semicolon. |