求助!怎样让控制台背景色与前景色(文字)不断的闪烁?
RT,我试过这样程序代码:
Random R = new Random(); int r = 1; for (int i = 1; i < 1000; i++) { Thread.Sleep(500); r = R.Next(1, 7); switch (r) { case 1: Console.BackgroundColor = ConsoleColor.Yellow; Console.ForegroundColor = ConsoleColor.DarkRed; break; case 2: Console.BackgroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.Black; break; case 3: Console.BackgroundColor = ConsoleColor.Red; Console.ForegroundColor = ConsoleColor.Green; break; case 4: Console.BackgroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Red; break; case 5: Console.BackgroundColor = ConsoleColor.Blue; Console.ForegroundColor = ConsoleColor.Gray; break; case 6: Console.BackgroundColor = ConsoleColor.Magenta; Console.ForegroundColor = ConsoleColor.White; break; } } Console.ReadKey();
可是不会变,麻烦大家帮帮忙啊 谢了!