在C#2.0中使用Console.Write同一位置写入字符串 [英] Writing string at the same position using Console.Write in C# 2.0
问题描述
我有一个控制台应用程序项目在C#2.0中需要写一些东西到屏幕while循环。我不想在屏幕上滚动,因为使用Console.Write或Console.Writeline方法将继续incremently显示在控制台屏幕上的文字,并因此开始滚动。
I have a console application project in C# 2.0 that needs to write something to the screen in a while loop. I do not want the screen to scroll because using Console.Write or Console.Writeline method will keep displaying text on console screen incremently and thus it starts scrolling.
我想有写在同一位置的字符串。我怎样才能做到这一点?
I want to have the string written at the same position. How can i do this?
感谢
推荐答案
使用<一个href="http://msdn.microsoft.com/en-us/library/system.console.setcursorposition.aspx">Console.SetCursorPosition设置位置。如果您需要首先确定它,使用 Console.CursorLeft 和<一HREF =http://msdn.microsoft.com/en-us/library/system.console.cursortop.aspx> Console.CursorTop 属性。
Use Console.SetCursorPosition to set the position. If you need to determine it first, use the Console.CursorLeft and Console.CursorTop properties.
这篇关于在C#2.0中使用Console.Write同一位置写入字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!