static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.White;//设置背景色
Console.ForegroundColor = ConsoleColor.Black;//设置字体颜色
Console.WriteLine(" 123");
Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(" 2222");
Console.BackgroundColor = ConsoleColor.Gray;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(" 3333");
Console.Read();
}
C#控制台为输出内容设置背景色和字体颜色
猜你喜欢
转载自www.cnblogs.com/anjun-xy/p/12896061.html
今日推荐
周排行