最佳解决方案的代码:

 

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 }

 

效果如图:C# 控制台应用程序输出颜色字体

 

相关文章:

  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-12-10
  • 2021-11-11
  • 2022-12-23
猜你喜欢
  • 2021-06-03
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案