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 }

 

效果如图:

 

posted @ 2017-06-27 13:42  marblemm  阅读(451)  评论(0编辑  收藏  举报