Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace test
- {
- class Program
- {
- static void Main(string[] args)
- {
- const string ExitCommand = "/Exit";
- const string CommandChangePassword = "/ChangePassword";
- const string CommandShowLogin = "/ShowLogin";
- const string CommandShowPassword = "/ShowPassword";
- const string CommandChangeNickname = "/ChangeNickname";
- string nickName = "User";
- string password = "*****";
- string inputUser = "";
- while (inputUser.ToUpper() != ExitCommand.ToUpper())
- {
- Console.WriteLine("Для выбора пункта меню введите следующие каманды:\n");
- Console.WriteLine($"Изменить пароль - {CommandChangePassword}" +
- $"\nПоказать Логин - {CommandShowLogin} " +
- $"\nПоказать пароль - {CommandShowPassword}" +
- $"\nИзменить никнеим - {CommandChangeNickname}" +
- $"\nВыход из программы - {ExitCommand}\n");
- inputUser = Console.ReadLine();
- Console.Clear();
- switch (inputUser)
- {
- case CommandChangePassword:
- Console.WriteLine("Введите пароль");
- password = Console.ReadLine();
- Console.Clear();
- Console.WriteLine("Пароль успешно изменен");
- break;
- case CommandShowLogin:
- Console.WriteLine($"Ваш никнейм {nickName}");
- break;
- case CommandShowPassword:
- Console.WriteLine($"Ваш пароль {password}");
- break;
- case CommandChangeNickname:
- Console.WriteLine("Введите никнем");
- nickName = Console.ReadLine();
- Console.Clear();
- Console.WriteLine("Никнейм успешно изменен");
- break;
- case ExitCommand:
- Console.WriteLine("Programm Close... .");
- break;
- default:
- Console.Clear();
- Console.WriteLine("Вы ввели не верную команду меню, попробуйте еще раз");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement