コード例 #1
0
        public User Login()
        {
            bool loggedIn = false;

            while (!loggedIn)
            {
                System.Console.Write("enter username:"******"enter password:"******"Invalid username/password");
                    continue;
                }
                if (ActiveUser.ValidatePassword(userPass))
                {
                    System.Console.WriteLine("Successfully Logged in");
                    loggedIn = true;
                    break;
                }
                else
                {
                    System.Console.WriteLine("Invalid username/password");
                }
            }

            return(ActiveUser);
        }