控制台当前行显示进度条,不换行
static void Main(string[] args) { for (int i = 0; i <= 100; i++) { Console.Write("\r当前进度{0}%",i); Thread.Sleep(1000); } }
利用\r将光标移到首部,然后输出覆盖
因缘际会的相遇,自当有非同寻常的结局
QQ交流群:110826636
static void Main(string[] args) { for (int i = 0; i <= 100; i++) { Console.Write("\r当前进度{0}%",i); Thread.Sleep(1000); } }
利用\r将光标移到首部,然后输出覆盖