如何在 C# 中更改控制台的 CursorTop?
要在 C# 中更改控制台的 CursorTop,请使用 Console.CursorTop 属性
举例
让我们看一个示例 -
using System;
class Demo {
public static void Main (string[] args) {
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("Background color changed = "+Console.BackgroundColor);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("
Foreground color changed = "+Console.ForegroundColor);
Console.CursorTop = 20;
Console.WriteLine("
CursorTop = "+Console.CursorTop);
}
}输出
这将产生以下输出 -

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP