コード例 #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string phone = context.Request["phone"];
            //测试用的验证码
            string code = Verification_Code.GetRandomint(4);

            context.Session["code"] = new SMS_Verification().VerCode(phone, code);//真实验证码
            string op = context.Request["op"];

            //找回密码
            if (op == "find")
            {
                int r = new UsersBll().ExistsByLoginId(phone);
                if (r < 1)
                {
                    context.Response.Write("nofind");
                }
                else
                {
                    context.Response.Write(code);
                }
            }
            else if (op == "reg")
            {
                context.Response.Write(code);
            }
        }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string s = Verification_Code.CreateRandomCode(4);

        Verification_Code.CreateImage(s);
        Session["CheckCode"] = s;
    }