/// <summary> /// 获取一个验证码配置信息实例 /// </summary> /// <returns></returns> public static ValidateCodeConfiger GetInstance() { ValidateCodeConfiger configer = new ValidateCodeConfiger(); configer.CharNum = 4; configer.FontSize = 14; configer.CharSpacing = 4; configer.Width = (configer.CharNum * configer.FontSize) + ((configer.CharNum) * configer.CharSpacing); configer.Height = configer.FontSize + 6; //configer.CharKind = En_CharKind.Chinese; configer.CharKind = En_CharKind.Number; configer.Noise = NoiseLine.GetInstance(); configer.BorderColor = Color.Black; configer.BackgroundColor = Color.White; return(configer); }
/// <summary> /// 构造方法 /// </summary> /// <param name="configer">验证码配置</param> public ValidateCode(ValidateCodeConfiger configer) { Configer = configer; AmendConfiger(); CreateCode(); }
/// <summary> /// 构造方法 /// </summary> public ValidateCode() { Configer = ValidateCodeConfiger.GetInstance(); CreateCode(); }