如何更改前景和背景文本颜色在控制台? [英] How to change foreground and background text color in console?

查看:173
本文介绍了如何更改前景和背景文本颜色在控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个控制台C#程序。我想改变前景和控制台文字的背景色。

I'm writing a console C# program. I would like to change the foreground and the background color of the text in console.

推荐答案

您只需要设置

Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.Red;



阅读所有关于它在的 http://www.dotnetperls.com/console-color

这篇关于如何更改前景和背景文本颜色在控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆