如何在控制台中更改光标位置? [英] How to change Cursor position in Console?
本文介绍了如何在控制台中更改光标位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在上一行中使用 Console.ReadLine();
并使其显示为:
I wanted to use Console.ReadLine();
in the previous line and make it display like that:
HeresomeText>(input)
不喜欢
HeresomeText>
(input)
有可能做吗?
推荐答案
使用Write方法而不是WriteLine方法:
use Write method instead of WriteLine Method:
Console.Write("HeresomeText> ")
此外,您还可以使用SetCursorPosition:
in addition you can use SetCursorPosition:
Console.SetCursorPosition(int left, int right);
这篇关于如何在控制台中更改光标位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文