Thursday, September 14, 2017

How do I set the color of the text in a C# console app?

if (resultOfAct.IsSuccessFul)
{
   Console.ForegroundColor = ConsoleColor.Green;
}
else
{
   Console.ForegroundColor = ConsoleColor.Red;
}

 
 

Gray seems to be the default color, not White.

No comments:

Post a Comment