protected void Page_Load(object sender, EventArgs e) { verifierString = imageVerifier.GetVerifierString("4"); Stream uri = imageVerifier.GetImage(verifierString); System.Drawing.Image img = System.Drawing.Image.FromStream(uri); img.Save(Path.Combine(Request.PhysicalApplicationPath, @"Member\img.jpeg"), ImageFormat.Jpeg); }
// get new image for image verification protected void Button1_Click(object sender, EventArgs e) { ImageVerifier.ServiceClient client = new ImageVerifier.ServiceClient(); string myStr = client.GetVerifierString("5"); Session["generatedString"] = myStr; }
protected void show_img_Click(object sender, EventArgs e) { ImageVerifier.ServiceClient imgPxy = new ImageVerifier.ServiceClient(); Session["userLength"] = "4"; string ans = imgPxy.GetVerifierString("4"); show_img.Text = "Show Me another Image string"; Image1.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { Response.Clear(); ImageVerifier.ServiceClient client = new ImageVerifier.ServiceClient(); Session["text"] = client.GetVerifierString("6"); Stream myStream = client.GetImage(Session["text"].ToString()); System.Drawing.Image myImage = System.Drawing.Image.FromStream(myStream); Response.ContentType = "image/jpeg"; myImage.Save(Response.OutputStream, ImageFormat.Jpeg); }
protected void btn_img_Click(object sender, EventArgs e) { try { Response.Clear(); ImageVerifier.ServiceClient test1 = new ImageVerifier.ServiceClient(); if (Session["generatedString"] == null) { imgVerifier = test1.GetVerifierString(5.ToString()); Image1.ImageUrl = "http://neptune.fulton.ad.asu.edu/WSRepository/Services/ImageVerifier/Service.svc/GetImage/" + imgVerifier; Session["generatedString"] = imgVerifier; // Storing in the session variable } else { imgVerifier = Session["generatedString"].ToString(); } } catch (Exception e1) { } }
protected void Page_Load(object sender, EventArgs e) { Response.Clear(); ImageVerifier.ServiceClient imgPxy = new ImageVerifier.ServiceClient(); string myStr, userLen; if (Session["userLength"] == null) { userLen = "4"; } else { userLen = Session["userLength"].ToString(); } myStr = imgPxy.GetVerifierString(userLen); Session["generatedString"] = myStr; Stream myStream = imgPxy.GetImage(myStr); System.Drawing.Image myImage = System.Drawing.Image.FromStream(myStream); Response.ContentType = "image/jpeg"; myImage.Save(Response.OutputStream, ImageFormat.Jpeg); }