📜  如何在 c# 代码示例中更改文本的颜色

📅  最后修改于: 2022-03-11 14:48:59.355000             🧑  作者: Mango

代码示例1
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);
   }
}