Beispiel #1
0
        private void AddUser()
        {
            Console.Out.WriteLine("Enter user name");
            PrintInputCharacter();
            string newUsername = Console.In.ReadLine();

            Console.Out.WriteLine("Enter user default password");
            PrintInputCharacter();
            string newPassword = PasswordHash(Console.In.ReadLine(), kSaltString);

            if (controller.CheckUserNameExist(newUsername))
            {
                Console.Out.WriteLine("Username exists, please change a new username");
            }
            else
            {
                controller.AddUser(newUsername, newPassword);
                Console.Out.WriteLine("Add user success");
            }
        }