C# 控制台应用程序输出颜色字体

最佳解决方案的代码:

1 static void Main(string[] args)
2 {
3 Console.ForegroundColor = ConsoleColor.Green;
4 Console.WriteLine("Hello, color text!");
5 Console.ForegroundColor = ConsoleColor.Red;
6 Console.WriteLine("Hello, color text!");
7 Console.ReadKey();
8 }

效果如图:

原文地址:https://www.cnblogs.com/marblemm/p/7084734.html