using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Text; using System.Drawing; public partial class Img : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string[] str = new string[4]; string serverCode=""; //生成随机生成器 Random random = new Random(); for (int i = 0; i < 4; i++) { str[i] = random.Next(10).ToString().Substring(0,1); } CreateCheckCodeImage(str); foreach(string s in str) { serverCode += s; } Session["serverCode"] = serverCode; } private void CreateCheckCodeImage(string[] checkCode) { if (checkC
生成验证码的CS代码Img.aspx.cs
最新推荐文章于 2024-07-22 17:45:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)