Medical/Mobile/js/login.ashx.cs

(完整代码) 2KB

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.SessionState;
using System.Web;

namespace WebApplication.Mobile.js
{
    /// <summary>
    /// login 的摘要说明
    /// </summary>
    public class login : IHttpHandler,IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Request["loginname"] != null && context.Request["password"] != null)
            {
                SqlParameter[] param = new SqlParameter[] {
                    new SqlParameter("@Mobile",SqlDbType.VarChar),
                    new SqlParameter("@PassWord",SqlDbType.VarChar)
                };
                param[0].Value = context.Request["loginname"];
                param[1].Value = WebApplication.Admin.Tools.Base64.Base64Code(context.Request["password"]);
                DataTable dt = DBUtility.DbHelperSQL.Query("select * from GZXX_U_UserTable where LoginName=@Mobile and PassWord=@PassWord and verify = 1", param).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    context.Session["LoginNameInfo"] = dt.Rows[0]["LoginName"].ToString();
                    context.Session["LoginUserPic"] = dt.Rows[0]["Pic"].ToString();
                    context.Session["LoginUserInfoID"] = dt.Rows[0]["InfoID"].ToString();
                    context.Session["LoginUserName"] = dt.Rows[0]["Title"].ToString();
                    //DBUtility.DbHelperSQL.ExecuteSql("update GZXX_U_UserTable set IsLogin = IsNull(IsLogin,0) + 1,LastLoginDate=getdate(),LastLoginIP='" + new DBUtility.IPAddress().IP_Address + "' where InfoID = " + dt.Rows[0]["InfoID"].ToString());
                    context.Response.Write("OK");
                }
                else
                {
                    context.Response.Write("账号或密码错误!");
                }
            }
            else
            {
                context.Response.Write("参数错误!");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

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

AI 解读

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

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