Introduction:
Here I will explain how to show or display output
console window in c#.net
or how to solve the problem of closing output console window immediately in c#.
Description:
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 c#.net 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 Aspdotnet-Suresh.com");
Console.ReadLine();
}
}
|
I hope it helps you. Happy
coding...
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
2 comments :
Sir,
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.
try console.readkey()
Note: Only a member of this blog may post a comment.