是否有可能写入到颜色.NET控制台?

是否有可能写入到颜色.NET控制台?

问题描述:

写一个小的命令行工具,这将是很好用不同的颜色输出。这可能吗?

Writing a small command line tool, it would be nice to output in different colours. Is this possible?

是的。请参阅此文章。下面是一个例子从那里:

Yes. See this article. Here's an example from there:

Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("White on blue.");