示例#1
0
        //[HandleErrorAction("OnIndexError")]
        public ActionResult Index(LoginInfo loginInfo)
        {
            if (string.Compare(loginInfo.UserName, "foo", true) != 0)
            {              
                throw new InvalidUserNameException();
            }

            if (loginInfo.Password != "password")
            {
                throw new InvalidPasswordException();
            }
            return View(loginInfo);
        }
示例#2
0
 public string Index(LoginInfo loginInfo)
 {
     string pwd;
     if (userAcccounts.TryGetValue(loginInfo.UserName, out pwd))
     {
         if (loginInfo.Password != pwd)
         {
             throw new InvalidPasswordException();
         }
         return "认证成功";
     }
     throw new InvalidUserNameException();
 }
示例#3
0
 public ActionResult OnIndexError(LoginInfo loginInfo)
 {
     return View(loginInfo);
 }