Verification Code Generation, java Verification Code Generation
Public ActionResult CheckCode ()
{
// First instantiate the Verification Code Class
ValidateCode validateCode = new ValidateCode ();
// Generate the length specified by the Verification Code
String code = validateCode. CreateValidateCode (5 );
// Assign the verification code to the Session variable
Session ["ValidateCode"] = code;
// Create an image of the Verification Code
Byte [] bytes = validateCode. CreateValidateGraphic (code );
// Finally return the verification code
Return File (bytes, @ "image/jpeg ");
}
Call Height = "32"/>
<A href = "javascript: void (0);" onclick = "ClickRemoveChangeCode ()"> change one </a>
Function ClickRemoveChangeCode (){
// First, we get the verification code path.
Var code = $ ("# imgCode"). attr ("src ");
// Then assign a value to the Verification code path.
$ ("# ImgCode"). attr ("src", code + "1 ");
}