Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSharpLight
- {
- public static class Program
- {
- public static void Main()
- {
- string login;
- string password;
- string email;
- string time;
- do
- {
- Console.WriteLine("Введите необходимую команду:\nlogin - установить логин для входа\npassword - установить пароль для входа\nemail - указать электронную почту\ntextchangecolor - изменить цвет текста на красный\nconsolechangecolor - изменить цвет консоли на синий\ntime - текущее время\nrandom - случайное число от 1 до 10\nclear - очистить консоль\nкнопка Esc - выход");
- string userInput = Console.ReadLine();
- switch (userInput)
- {
- case "login":
- Console.WriteLine("Придумайте себе логин:");
- login = Console.ReadLine();
- Console.WriteLine("Ваш логин принят");
- break;
- case "password":
- Console.WriteLine("Придумайте себе пароль:");
- password = Console.ReadLine();
- Console.WriteLine("Ваш пароль принят");
- break;
- case "email":
- Console.WriteLine("email:");
- email = Console.ReadLine();
- Console.WriteLine("Вы указали свою почту");
- break;
- case "textchangecolor":
- Console.ForegroundColor = ConsoleColor.Red;
- break;
- case "consolechangecolor":
- Console.BackgroundColor = ConsoleColor.Blue;
- break;
- case "time":
- time = Convert.ToString(DateTime.Now);
- Console.WriteLine(time);
- break;
- case "random":
- Console.WriteLine("Введите число от");
- int randomMin = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите число до");
- int randomMax = Convert.ToInt32(Console.ReadLine());
- Random rand = new Random();
- int randomNumber = rand.Next(randomMin, randomMax);
- Console.WriteLine(randomNumber);
- break;
- case "clear":
- Console.Clear();
- break;
- default:
- Console.WriteLine("такой команды нет");
- break;
- }
- }
- while (Console.ReadKey().Key != ConsoleKey.Escape);
- }
- }
- }
Add Comment
Please, Sign In to add comment