Looking at this LINQ demo:
When going in debug mode, the output have colors in it. I'm using the same ObjectDumper class and I only have the black/white console window.
How can I have the same results in the console window?
Thanks
Looking at this LINQ demo:
When going in debug mode, the output have colors in it. I'm using the same ObjectDumper class and I only have the black/white console window.
How can I have the same results in the console window?
Thanks
You can set colors of the console text and/or background in the properties if that's what you're looking for... Just right click the title bar, click Properties and choose desired colors.
If you want to control this programmatically, use the System.Console.ForegroundColor
property.
http://msdn.microsoft.com/en-us/library/system.console.foregroundcolor.aspx
What about :
Console.ForegroundColor = ConsoleColor.Yellow;
Console.BackgroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Test");
Daok have what you want...
But you can always use Win32 calls.
[DllImport("kernel32.dll")] public static extern bool SetConsoleTextAttribute(IntPtr hConsoleOutput, int wAttributes);
[DllImport("kernel32.dll")] public static extern IntPtr GetStdHandle(uint nStdHandle);