Why is the console window closing immediately once displayed my output?

前端 未结 21 2656
死守一世寂寞
死守一世寂寞 2020-11-22 03:45

I\'m studying C# by following the guides in MSDN.

Now, I just tried the Example 1 (here is the link to MSDN), and I\'ve encountered an i

21条回答
  •  野的像风
    2020-11-22 03:57

    I always add the following statement to a console application.(Create a code snippet for this if you wish)

    Console.WriteLine("Press any key to quit!");
    Console.ReadKey();
    

    Doing this helps when you want to experiment different concepts through console application.

    Ctr + F5 will make the Console stay but you cant debug! All the console applications that I have written in realworld is always non-interactive and triggered by a Scheduler such as TWS or CA Work station and did not require something like this.

提交回复
热议问题