如何在 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