Exemplo n.º 1
0
        // GET: VerifyCode
        public ActionResult Index()
        {
            string strVerifyCode = VerifyCodeHelper.CreateRandomCode(4);

            SessionHelper.VerifyCode.SetSession(strVerifyCode);
            return(File(VerifyCodeHelper.CreateValidateGraphic(strVerifyCode), "image/Jpeg"));
        }
Exemplo n.º 2
0
        private void CreateValidation()
        {
            VerifyCodeHelper helper = new VerifyCodeHelper();

            pictureBox2.Image = helper.CreateImage();
            lblCode.Text      = helper.CreateRandomCode();
        }
        public string GetShareCode()
        {
            DateTime dateTime     = DateTime.Now;
            string   strShareCode = string.Empty;

            while (string.IsNullOrEmpty(strShareCode) || IsExistShareCode(strShareCode))
            {
                strShareCode = VerifyCodeHelper.CreateRandomCode(8);
            }
            return(strShareCode);
        }