ashx/reg.ashx

(完整代码) 1KB

<%@ WebHandler Language="C#" Class="reg" %>

using System;
using System.Web;

public class reg : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
      
        
        int result = 0;
        if (context.Request.Form["username"]!=null)
        {
            string username = context.Server.UrlDecode(context.Request.Form["username"].ToString());
            result = DBHelper.GetScalar(string.Format("select count(1) from reg_user where username='{0}' or mobile='{1}' or email='{2}'", username, username, username));
        }
        if (context.Request.Form["Email"] != null)
        {
            string Email = context.Server.UrlDecode(context.Request.Form["Email"].ToString());
            result = DBHelper.GetScalar(string.Format("select count(1) from reg_user where username='{0}' or mobile='{1}' or email='{2}'", Email, Email, Email));
        }
        if (context.Request.Form["Mobile"] != null)
        {
            string Mobile = context.Server.UrlDecode(context.Request.Form["Mobile"].ToString());
            result = DBHelper.GetScalar(string.Format("select count(1) from reg_user where username='{0}' or mobile='{1}' or email='{2}'", Mobile, Mobile, Mobile));
        }
         if (result > 0)
         {
             //表示不可用已经存在过了
             context.Response.Write("no");
         }
         else
         {
             //可用 未被注册过
             context.Response.Write("ok");
         }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}

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

AI 解读

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

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