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

前端 未结 21 2536
死守一世寂寞
死守一世寂寞 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

    To simplify what others are saying: Use Console.ReadKey();.

    This makes it so the program is waiting on the user to press a normal key on the keyboard

    Source: I use it in my programs for console applications.

提交回复
热议问题