MiniMicro
پنج شنبه 26 دی 1392, 15:53 عصر
با سلام خدمت همه دوستان یه سوال؟
این کد در لاگین چه کاری انجام میدهد
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrin gs["LibraryConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand("select Username from tblAdmin where Username='"+username.Text+"' and Password='"+password.Text+"'",con);
con.Open();
object obj = cmd.ExecuteScalar();
//lblerror.Text = obj.ToString();
if (obj == null)
{
con.Close();
lblerror.Text = "نام کاربری یا رمز عبور اشتباه است";
}
else {
con.Close();
Session["admin"] = username.Text;
Response.Redirect("mngmanager.aspx");
// HyperLink hp = new HyperLink();
// hp.NavigateUrl = "mngmanager.aspx";
}
دو خط آخر...
Session["admin"] = username.Text;
Response.Redirect("mngmanager.aspx")
این کد در لاگین چه کاری انجام میدهد
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrin gs["LibraryConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand("select Username from tblAdmin where Username='"+username.Text+"' and Password='"+password.Text+"'",con);
con.Open();
object obj = cmd.ExecuteScalar();
//lblerror.Text = obj.ToString();
if (obj == null)
{
con.Close();
lblerror.Text = "نام کاربری یا رمز عبور اشتباه است";
}
else {
con.Close();
Session["admin"] = username.Text;
Response.Redirect("mngmanager.aspx");
// HyperLink hp = new HyperLink();
// hp.NavigateUrl = "mngmanager.aspx";
}
دو خط آخر...
Session["admin"] = username.Text;
Response.Redirect("mngmanager.aspx")