Advertisement
alexey3017

Untitled

Mar 20th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             bool isActive = true;
  14.             string userInput;
  15.             string name;
  16.  
  17.             while (isActive)
  18.             {
  19.                 Console.Clear();
  20.                 Console.WriteLine("FontColor или '1' - сделать шрифт синим цветом");
  21.                 Console.WriteLine("ConsoleColor или '2' - сделать фон белым цветом");
  22.                 Console.WriteLine("SetName или '3'- Установить имя");
  23.                 Console.WriteLine("Setcolor или '4' - cделать фон черным");
  24.                 Console.WriteLine("Wiewphrase или '5' - Вывести фразу дня   ");
  25.                 Console.WriteLine("Esc или '0' - Выход из программы");
  26.                 userInput = Console.ReadLine().ToLower();
  27.  
  28.                 switch (userInput)
  29.                 {
  30.                     case "1":
  31.                     case "fontcolor":
  32.                         Console.ForegroundColor = ConsoleColor.Blue;
  33.                         break;
  34.                     case "2":
  35.                     case "consolecolor":
  36.                         Console.BackgroundColor = ConsoleColor.White;
  37.                         break;
  38.                     case "3":
  39.                     case "setname":
  40.                         Console.WriteLine("Введите свое имя:");
  41.                         name = Console.ReadLine();
  42.                         Console.WriteLine("Ваше имя: " + name);
  43.                         Console.WriteLine("Введите любую кнопку для продолжения");
  44.                         Console.ReadKey();
  45.                         break;
  46.                     case "4":
  47.                     case "setcolor":
  48.                         Console.BackgroundColor = ConsoleColor.Black;
  49.                         break;
  50.                     case "5":
  51.                     case "wiewphrase":
  52.                         Console.WriteLine("Счастье - это не обладание тем, чего желаешь, а желание того, чем обладаешь. ");
  53.                         Console.WriteLine("Введите любую кнопку для продолжения");
  54.                         Console.ReadKey();
  55.                         break;
  56.                     case "0":
  57.                     case "esc":
  58.                         isActive = false;
  59.                         Console.WriteLine("До свидание.");
  60.                         break;
  61.                     default:
  62.                         Console.WriteLine("Введите актуальную команду!");
  63.                         break;
  64.                 }
  65.  
  66.             }
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement