/*Function for generate button to take the string length from textbox and * call the GetVerifierString and GetImage functionality * and display the image in the picture*/ private void generate_button_Click(object sender, EventArgs e) { ServiceReference3.ServiceClient myclient = new ServiceReference3.ServiceClient(); string image_input = textBox6.Text; string result = myclient.GetVerifierString(image_input); Stream stream_data = myclient.GetImage(result); var myImage = Image.FromStream(stream_data); pictureBox1.Image = myImage; image_val = result; }
/*Function for verify button to check if the string entered from the image is * correct or not*/ private void verify_button_Click(object sender, EventArgs e) { ServiceReference3.ServiceClient myclient = new ServiceReference3.ServiceClient(); string verify_input = textBox8.Text; if (image_val == verify_input) { textBox9.Text = "The string entered is correct"; } else { textBox9.Text = "Not the correct string. Try again"; } }