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

前端 未结 21 2291
死守一世寂寞
死守一世寂寞 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 03:59

    Alternatively, you can delay the closing using the following code:

    System.Threading.Thread.Sleep(1000);
    

    Note the Sleep is using milliseconds.

提交回复
热议问题