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

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

    Instead of using

    Console.Readline()
    Console.Read()
    Console.ReadKey()
    

    you can run your program using Ctrl+F5 (if you are in Visual Studio). Then Visual Studio will keep the console window open, until you press a key.

    Note: You cannot debug your code in this approach.

提交回复
热议问题