Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string SetName;
- string SetSurname;
- string SetAge;
- string SetLogin;
- string SetPassword;
- int ChangeTextColor;
- string ChangeConsoleColor;
- string WriteAllData;
- bool Exit = true;
- string UserInput;
- while (Exit)
- {
- Console.WriteLine("Выберите нужную команду:\n 1 <-- Ввести имя.\n 2 <-- Ввести фамилию.\n 3 <-- Ввести возраст.\n 4 <-- Ввести логин.\n 5 <-- Ввести пароль.\n 6 <-- Поменять цвет текста.\n 7 <-- Поменять цвет консоли.\n 8 <-- Выйти из программы.");
- UserInput = Console.ReadLine();
- switch (UserInput)
- {
- case "1":
- Console.WriteLine("Введите имя:");
- SetName = Console.ReadLine();
- Console.Clear();
- break;
- case "2":
- Console.WriteLine("Введите фамилию:");
- SetSurname = Console.ReadLine();
- Console.Clear();
- break;
- case "3":
- Console.WriteLine("Введите возраст:");
- SetAge = Console.ReadLine();
- Console.Clear();
- break;
- case "4":
- Console.WriteLine("Введите логин");
- SetLogin = Console.ReadLine();
- Console.Clear();
- break;
- case "5":
- Console.WriteLine("Введите пароль");
- SetPassword = Console.ReadLine();
- Console.Clear();
- break;
- case "6":
- Console.WriteLine("Выберете цвет текста:\n 1 <-- красный.\n 2 <-- синий");
- ChangeTextColor = Convert.ToInt32(Console.ReadLine());
- if (ChangeTextColor == 1 )
- {
- Console.ForegroundColor = ConsoleColor.Red;
- }
- else if (ChangeTextColor == 2 )
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- }
- Console.Clear();
- break;
- case "7":
- Console.WriteLine("Выберете цвет консоли:\n 1 <-- зеленый.\n 2 <-- жёлтый");
- ChangeTextColor = Convert.ToInt32(Console.ReadLine());
- if (ChangeTextColor == 1)
- {
- Console.BackgroundColor = ConsoleColor.Green;
- }
- else if (ChangeTextColor == 2)
- {
- Console.BackgroundColor = ConsoleColor.Yellow;
- }
- Console.Clear();
- break;
- case "8":
- Exit = false;
- break;
- default:
- Console.Clear();
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement