aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

C# - Output Console Window Closing Automatically without Showing Output

Sep 22, 2013

Here I will explain how to show or display output console window in or how to solve the problem of closing output console window immediately in c#.


In previous articles I explained polymorphism example in c#, delegates in c# with example, Difference b/w compile time and runtime polymorphism, sealed classes in and many articles relating to c#, code snippets. Now I will explain how to solve the problem of closing output console window immediately in c#.

Show output console window

Generally whenever we run console applications once that execution finished automatically output window will close and return to application. In this situation if you want to show output window even if application execution finish we need to add Console.ReadLine()at the end of your code like as shown below

class Program
static void Main(string[] args)
Console.WriteLine("Welcome to");

I hope it helps you. Happy coding...

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...

I tried a simple console application program. But everytime i run the program, the output window pop ups and and shows blank but the program is correct with no errors.

piyush rai said...

try console.readkey()

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.