У нас вы можете посмотреть бесплатно C# tips and tricks 24 - How to change text color and text background color in a Console application. или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
How to change text color and text background color in a Console application. Like our facebook page www.facebook.com/ankprotraining Console Class The Console class provides basic input and output support for applications that read from and write characters to the console. This is a static class and This can not be inherited. ConsoleColor Enum Specifies constants that define foreground and background colors for the console. ForegroundColor and BackgroundColor ForegroundColor is a property present in Console Class Gets or sets the foreground color of each character that is displayed. BackgroundColor is also a property present in Console Class Gets or sets the background color that appears behind each character. Code : class Program { static void Main(string[] args) { //Console.ForegroundColor = ConsoleColor.Blue; //Console.BackgroundColor = ConsoleColor.Green; //Console.WriteLine("Ankpro Technologies"); Console.WriteLine("All text colors"); foreach (var item in Enum.GetValues(typeof(ConsoleColor))) { Console.ForegroundColor = (ConsoleColor)item; Console.WriteLine("Ankpro technilogies"); } Console.WriteLine("All text background colors"); foreach (var item in Enum.GetValues(typeof(ConsoleColor))) { Console.BackgroundColor = (ConsoleColor)item; Console.WriteLine("Ankpro technilogies"); } } }