Exemplo n.º 1
0
        /// <summary>
        /// 获取随机验证码
        /// </summary>
        /// <returns>验证码图片</returns>
        public FileContentResult GetRandomAuthCode()
        {
            AuthCode auCode = new AuthCode(4);
            string strCode = auCode.GetRandomCode();
            Session[SysContext.ConstKeys.Session_AuthCode] = strCode;
            byte[] imageByte = auCode.CreateJpegImage(strCode);

            return File(imageByte, @"image/jpeg");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取随机验证码
        /// </summary>
        /// <returns>验证码图片</returns>
        public FileContentResult GetRandomAuthCode()
        {
            AuthCode auCode  = new AuthCode(4);
            string   strCode = auCode.GetRandomCode();

            Session[SysContext.ConstKeys.Session_AuthCode] = strCode;
            byte[] imageByte = auCode.CreateJpegImage(strCode);

            return(File(imageByte, @"image/jpeg"));
        }