/// <summary> /// Initializes a new instance of the <see cref="T:Common.Utility.PictureCAPTCHA"/> class with number list; /// </summary> /// <param name="Length">Length.</param> public PictureCAPTCHA(int Length) { HttpContext.Current.Response.Expires = 0; HttpContext.Current.Response.Buffer = true; HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1); HttpContext.Current.Response.AddHeader("pragma", "no-cache"); HttpContext.Current.Response.CacheControl = "no-cache"; LetterCount = Length; Text = StringCAPTCHA.Number(LetterCount); CreateImage(); }
private void InitText() { switch (Type) { case 0: Text = StringCAPTCHA.Number(LetterCount); break; case 1: Text = StringCAPTCHA.Char(LetterCount); break; case 2: Text = StringCAPTCHA.Mixed(LetterCount); break; default: break; } }