Rewriting characters in command window

后端 未结 2 2022
抹茶落季
抹茶落季 2021-01-19 06:39

I want to output some characters in C# console application and then rewrite them, thus changing characters in position already occupied in command window. So for for example

2条回答
  •  无人及你
    2021-01-19 06:57

    If you print a '\r' character, the cursor will return back to the current line, e.g.

    Console.Write("10%\r");
    // then..
    Console.Write("20%\r");
    

提交回复
热议问题