第五种/ValidateCode.aspx.cs

(完整代码) 1009B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 验证码.第五种
{
    public partial class ValidateCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            validatedCode v = new validatedCode();
            string code = v.CreateVerifyCode(); //取随机码
            
            v.CreateImageOnPage(code, this.Context); // 输出图片 
            Session["CheckCode"] = code; //Session 取出验证码

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string vCode = Session["CheckCode"].ToString(); 
            if (txtValidatedcode.Text.Trim().ToUpper() == vCode.ToUpper()) 
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Startup", "alert('ValidatedCode is right!');", true); 
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。