Ejemplo n.º 1
0
        public PartialViewResult _ImageCode(ImageCodeModel model)
        {
            if (!isCookieEnabled())
            {
                ModelState.AddModelError("InputImageCode", string.Format("* 检查不到{0},请确保cookie已启用", "<a href='#'>cookie</a>"));
            }
            if (model.ImageCodeError == ImageCodeError.Expired)
            {
                ModelState.AddModelError("InputImageCode", "* 验证码已过期,请重新输入");
            }
            else if (model.ImageCodeError == ImageCodeError.Wrong)
            {
                ModelState.AddModelError("InputImageCode", "* 验证码错误,请重新输入");
            }

            imageCodeHelper.ClearImageCode();

            return PartialView(model);
        }
Ejemplo n.º 2
0
        internal ImageCodeModel CheckResult()
        {
            ImageCodeModel model = new ImageCodeModel();

            model.InputImageCode = Context.Request.Form["InputImageCode"];
            model.ImageCodeError = CheckImageCode(model.InputImageCode);

            return model;
        }