Computer >> 컴퓨터 >  >> 프로그램 작성 >> C#

C#에서 콘솔의 CursorLeft를 변경하는 방법은 무엇입니까?

<시간/>

C#에서 콘솔의 CursorLeft를 변경하려면 Console.CursorLeft 속성을 사용하세요.

예시

예를 들어 보겠습니다 -

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("\nForeground color changed = "+Console.ForegroundColor);
      Console.CursorLeft = 30;
      Console.Write("CursorLeft position: "+Console.CursorLeft);
   }
}

출력

이것은 다음과 같은 출력을 생성합니다 -

C#에서 콘솔의 CursorLeft를 변경하는 방법은 무엇입니까?