Пример #1
0
        /// <summary>
        /// 按动作类型  获取验证码类型
        /// </summary>
        /// <param name="actionType"></param>
        /// <returns></returns>
        public static ValidateCodeType GetValidateCodeTypeByAction(string actionType)
        {
            string codeTypeString = null;

            foreach (ValidateCode tempValidateCode in AllSettings.Current.ValidateCodeSettings.ValidateCodes)
            {
                if (string.Compare(tempValidateCode.ActionType, actionType, true) == 0)
                {
                    codeTypeString = tempValidateCode.ValidateCodeType;
                    break;
                }
            }

            ValidateCodeType validateCodeType = null;

            if (codeTypeString == null)
            {
            }
            else
            {
                validateCodeType = GetValidateCodeType(codeTypeString);
            }

            if (validateCodeType == null)
            {
                validateCodeType = new ValidateCode_Style1();
            }

            return(validateCodeType);
        }
Пример #2
0
        /// <summary>
        /// 按动作类型  获取验证码类型
        /// </summary>
        /// <param name="actionType"></param>
        /// <returns></returns>
        public static ValidateCodeType GetValidateCodeTypeByAction(string actionType)
        {
            string codeTypeString = null;

            foreach (ValidateCode tempValidateCode in AllSettings.Current.ValidateCodeSettings.ValidateCodes)
            {
                if (string.Compare(tempValidateCode.ActionType, actionType, true) == 0)
                {
                    codeTypeString = tempValidateCode.ValidateCodeType;
                    break;
                }
            }

            ValidateCodeType validateCodeType = null;

            if (codeTypeString == null)
            {
            }
            else
            {
                validateCodeType = GetValidateCodeType(codeTypeString);
            }

            if (validateCodeType == null)
                validateCodeType = new ValidateCode_Style1();

            return validateCodeType;
        }