CSharp examples for System.Drawing:Color
Write Line with console color
using System;//from ww w. j a v a 2 s . c o m public class Main{ public static void WriteLine(ConsoleColor color, object obj) { WriteLine(color, obj.ToString(), null); } public static void WriteLine(ConsoleColor color, string format, params object[] objects) { var previousColor = Console.ForegroundColor; Console.ForegroundColor = color; if (objects == null) { Console.WriteLine(format); } else { Console.WriteLine(format, objects); } Console.ForegroundColor = previousColor; } }