コード例 #1
0
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string    Encryptedpass = FormsAuthentication.HashPasswordForStoringInConfigFile(tb_password.Text, "SHA1");
                DataTable data          = Garge.get_data(tb_user.Text, Encryptedpass, "true");
                if (data.Rows.Count > 0)
                {
                    Session["UserID"] = data.Rows[0]["GaragID"].ToString();
                    Response.Redirect("~/Admin2HomePage.aspx");
                }

                else
                {
                    Lblreg.Text      = "שם משתמש או סיסמא אינם נכונים!";
                    Lblreg.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                Lblreg.Text      = "חובה למלא שדות חובה!";
                Lblreg.ForeColor = System.Drawing.Color.Red;
            }
        }