所以这是我的代码,我只想在按任何键后关闭程序,然后程序应该会显示一条消息,说明你的程序将在10,9,8,7分钟内关闭……我知道这很简单,但是我刚开始我的编程之旅,我就是找不到解决这个问题的方法。
Dim count as Integer
Console.WriteLine("Please press any key to close the program...")
For count = 10 To 1 Step -1
Console.WriteLine("Program will close in: " & count)
Console.ReadKey()
Next发布于 2019-01-22 06:38:54
Dim count As Integer
Console.WriteLine("Please press any key to close the program...")
Console.ReadKey()
For count = 10 To 1 Step -1
Console.WriteLine("Program will close in: " & count)
Threading.Thread.Sleep(1000)
Next这看起来就是你想要做的--但请记住,两次睡眠之间有处理时间--所以你的倒计时不会精确到毫秒。您也可以使用计时器来实现这一点。
https://stackoverflow.com/questions/54294594
复制相似问题