Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="type">验证码类型</param>
 /// <param name="number">数量</param>
 /// <param name="width">单个字宽度</param>
 /// <param name="height">单个字高度</param>
 public YzmHelper(RandType type, int number, int width, int height)
 {
     if (width > 0)
     {
         this.letterWidth = width;
     }
     if (height > 0)
     {
         this.letterHeight = height;
     }
     SetRandType(type, number);
 }
Exemplo n.º 2
0
        private void SetRandType(RandType type, int number)
        {
            switch (type)
            {
            case RandType.Letters:
                this.Text = Rand.Str_char(number);
                break;

            case RandType.NumbersAndLetters:
                this.Text = Rand.Str(number);
                break;

            default:
                this.Text = Rand.Number(number);
                break;
            }
        }
Exemplo n.º 3
0
 public Xavier(RandType randType = RandType.Gaussian, FactorType factorType = FactorType.Average, float magnitude = 3)
 {
     this.Rand      = randType;
     this.Factor    = factorType;
     this.Magnitude = magnitude;
 }
Exemplo n.º 4
0
 public YzmHelper(RandType type, int number)
 {
     SetRandType(type, number);
 }