首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    .net 登陆代码

    protected void Button1_Click(object sender, EventArgs e)     {         string myconnectionstring = System.Configuration.ConfigurationManager.AppSettings["connstr"];         string mycommandstring = "SELECT * FROM who where who_name=" + "’" + TextBox1.Text + "’" + "and who_pwd = " + "’" + TextBox2.Text+ "’";         SqlConnection myconnection = new SqlConnection(myconnectionstring);         SqlCommand mycommand = new SqlCommand(mycommandstring, myconnection);         myconnection.Open();         SqlDataReader myreader = mycommand.ExecuteReader();         if (myreader.Read())         {           Session["name"] = myreader["who_name"].ToString();           Response.Redirect("postdoing.aspx");         }         else         {             Response.Write("<script>alert(‘用户名或密码不正确,请重新登陆’);</script>");             Response.Redirect("login.aspx");         }     }

    04
    领券