求!!生成验证码代码!
哪位仁兄有生成图片验证码的代码呀!!!谢了!!!
大概是这样的:
Bitmap bmp = new Bitmap(112,37);
Graphics g = Graphics.FromImage(bmp);
...用随即得到的东西画出来...
MenoryStream ms = new MemoryStream();
bmp.Save(ms,System.Drawing.Imaging.ImageFormat.Png);//Save
Reasponse.ClearContent();
Reasponse.ContentType="image/png";
Reasponse.BinaryWrite(ms.ToArray());//Write
Reasponse.End();
把这段加在Load里面就可以生成了,当然了,密码就是随机得到的那些东西了~