protected void Page_Load(object sender, EventArgs e) { //generate an image of length 5 for verification if (!IsPostBack) { ImageVerifierService.Service verifierService = new ImageVerifierService.Service(); Session["verifyString"] = verifierService.GetVerifierString("5"); ImageVerifierImage.ImageUrl = "data:image/jpeg;base64," + Convert.ToBase64String(verifierService.GetImage(Session["verifyString"].ToString())); } }
//in case the image is too hard to read protected void ReloadVerification_Click(object sender, EventArgs e) { ImageVerifierService.Service verifierService = new ImageVerifierService.Service(); Session["verifyString"] = verifierService.GetVerifierString("8"); ImageVerifierImage.ImageUrl = "data:image/jpeg;base64," + Convert.ToBase64String(verifierService.GetImage(Session["verifyString"].ToString())); }