Schriftfarbe in der Console ändern
über enums iterieren
.net snippets zum Geburtstag gratulieren :)
using System;
using System.Threading;
namespace HappyBirthday
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
foreach (ConsoleColor color in Enum.GetValues(typeof(ConsoleColor)))
{
if (color == ConsoleColor.Black) continue;
Console.ForegroundColor = color;
Thread.Sleep(5 * 10);
Console.Clear();
Console.WriteLine("\n\n\n\n\n\n\t\t\tHappy 10th birthday dotnet-snippets.de");
}
}
}
}
}
3 Kommentare zum Snippet