Click here to Skip to main content
15,892,746 members
Articles / Programming Languages / C#
Tip/Trick

When you run a console application from visual studio the application run so fast and the console closes that you never see the output.

Rate me:
Please Sign up or sign in to vote.
2.60/5 (4 votes)
4 Feb 2010CPOL 24.8K   6
ohhh...this is an easy fix. Just put down the statement Console.Readline() as the last line in your program. This will keep the window open until you hit the enter key.That's cool!!!!!!
ohhh...this is an easy fix. Just put down the statement Console.Readline() as the last line in your program. This will keep the window open until you hit the enter key.
That's cool!!!!!!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Kovair Inc.
India India
I have started programming in 10 years on Fortran 77.Then it was Cobol,C,C++,JAVA 1.2, ASP,JavaScript. Now it at all C# and .NET Framework, such tehnologies as WCF, ADO.NET, ASP.NET, LINQ, ASP.NET Ajax , FLEX and another.

Comments and Discussions

 
GeneralRe: Palash Biswas Pin
AspDotNetDev4-Feb-10 10:07
protectorAspDotNetDev4-Feb-10 10:07 
QuestionAny way to make that happen in the IDE only? Pin
supercat94-Feb-10 7:12
supercat94-Feb-10 7:12 
AnswerRe: Any way to make that happen in the IDE only? Pin
AspDotNetDev4-Feb-10 10:09
protectorAspDotNetDev4-Feb-10 10:09 
GeneralRe: Any way to make that happen in the IDE only? Pin
supercat94-Feb-10 12:28
supercat94-Feb-10 12:28 
GeneralRe: Any way to make that happen in the IDE only? Pin
AspDotNetDev4-Feb-10 13:46
protectorAspDotNetDev4-Feb-10 13:46 
AnswerRe: Any way to make that happen in the IDE only? Pin
AWdrius4-Feb-10 21:21
AWdrius4-Feb-10 21:21 
You might use

if (Debugger.IsAttached)
{
  // do something
}


Trust is a weakness.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.