文件名称:简单的网页验证码实例
文件大小:4KB
文件格式:7Z
更新时间:2012-07-27 05:14:39
网页 验证码
protected void Page_Load(object sender, EventArgs e) { VryImgGen gen = new VryImgGen(); string verifyCode = gen.CreateVerifyCode(5, 1); Session["VerifyCode"] = verifyCode.ToUpper(); System.Drawing.Bitmap bitmap = gen.CreateImage(verifyCode); System.IO.MemoryStream ms = new System.IO.MemoryStream(); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png); Response.Clear(); Response.ContentType = "image/Png"; Response.BinaryWrite(ms.GetBuffer()); bitmap.Dispose(); ms.Dispose(); ms.Close(); Response.End(); }
【文件预览】:
验证码
----App_Code()
--------VryImgGen.cs(9KB)
----VerifyCode.aspx(448B)
----VerifyCode.aspx.cs(954B)
----VerifyCode.ascx.cs(433B)
----Show.aspx.cs(405B)
----Show.aspx(682B)
----VerifyCode.ascx(123B)