帮我写一个一个用c#.net连接sqlserver数据库做成的登录系统

2024-11-20 08:45:46
推荐回答(1个)
回答1:

protected void Login(object sender, EventArgs e)
{
// connection database
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["DataBaseConnectionString"].ToString());

string str_username = username.Text.Trim();
string str_password = password.Text.Trim();

UserDao ud = new UserDao();
if (ud.checkUser(str_username, str_password))
{
Response.Redirect("Default2.aspx");
}
else
Response.Write("");
}