Пример #1
0
        /// <summary>
        /// Asks the user which username to add.
        /// </summary>
        private void ShowAddUser()
        {
            Console.Write("Please enter the username to add: ");
            string name = Console.ReadLine();

            if (_proxy.IsUserPresent(name))
            {
                Console.WriteLine("Username already exists in database.");
                return;
            }
            Console.Write("Please enter the password: "******"\r\nPlease enter the password again: ");
            string pass2 = Console.ReadLine();

            ConsoleAttributes.EchoInput = true;
            if (!pass1.Equals(pass2))
            {
                Console.WriteLine("\r\nThe passwords do not match.");
                return;
            }
            _proxy.AddUser(name, pass1);
        }