예제 #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            string user = username.Value.Trim();
            string pass = password.Value.Trim();

            int userId = 0;
            Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
            ul.UserLoginCheck(user, Tunnel.Data.DESEncrypt.Encrypt(pass), Tunnel.Common.Common.GetIp(), ref userId);
            if (userId > 0)
            {
                Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
                Tunnel.Common.GetValue.OnLine(userId);
                Response.Redirect("Index.aspx");
            }
            else
            {
                Response.Write("<script>alert('账号或密码错误!');location.href='default.aspx';</script>");
                Response.End();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }