Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool isActive = true;
- string userInput;
- string name;
- while (isActive)
- {
- Console.Clear();
- Console.WriteLine("FontColor или '1' - сделать шрифт синим цветом");
- Console.WriteLine("ConsoleColor или '2' - сделать фон белым цветом");
- Console.WriteLine("SetName или '3'- Установить имя");
- Console.WriteLine("Setcolor или '4' - cделать фон черным");
- Console.WriteLine("Wiewphrase или '5' - Вывести фразу дня ");
- Console.WriteLine("Esc или '0' - Выход из программы");
- userInput = Console.ReadLine().ToLower();
- switch (userInput)
- {
- case "1":
- case "fontcolor":
- Console.ForegroundColor = ConsoleColor.Blue;
- break;
- case "2":
- case "consolecolor":
- Console.BackgroundColor = ConsoleColor.White;
- break;
- case "3":
- case "setname":
- Console.WriteLine("Введите свое имя:");
- name = Console.ReadLine();
- Console.WriteLine("Ваше имя: " + name);
- Console.WriteLine("Введите любую кнопку для продолжения");
- Console.ReadKey();
- break;
- case "4":
- case "setcolor":
- Console.BackgroundColor = ConsoleColor.Black;
- break;
- case "5":
- case "wiewphrase":
- Console.WriteLine("Счастье - это не обладание тем, чего желаешь, а желание того, чем обладаешь. ");
- Console.WriteLine("Введите любую кнопку для продолжения");
- Console.ReadKey();
- break;
- case "0":
- case "esc":
- isActive = false;
- Console.WriteLine("До свидание.");
- break;
- default:
- Console.WriteLine("Введите актуальную команду!");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement