|
1金钱
protected void btnok_Click(object sender, EventArgs e)
{
DataTable dta_user = dss.disptable("select * from users where u_name='"+txbuser.Text.Trim()+"'","us");//查询表
if (dta_user.Rows.Count == 0)
Response.Write("<script>alert('该用户不存在!')</script>");
else
{
if (dta_user.Rows[0].ItemArray[1].ToString() == txbpwd.Text.Trim())
Response.Redirect("index.aspx");
else
Response.Write("<script>alert('密码错误!')</script>");
}
}
protected void btnadd_Click(object sender, EventArgs e)
{
dss.operate("insert into users values('" + txbuser.Text.Trim() + "','" + txbpwd.Text.Trim() + "')");
Response.Write("<script>alert('添加成功!')</script>");
}
|
|