62,046
社区成员
发帖
与我相关
我的任务
分享
string UsName = us.Text;
string PsName = ps.Text;
if (Session["UsName"] == null)
{
Response.Redirect("Login.aspx");
}else
{
SqlConnection conn = new SqlConnection("Data Source=localhost;Initial Catalog=YaoPin;Integrated Security=True");
conn.Open();
SqlCommand cmd = new SqlCommand("select * from User_table where uname='" + UsName + "' and upassword='" + PsName + "'", conn);
int conut = Convert.ToInt32(cmd.ExecuteScalar());
conn.Close();
if (conut > 0)
{
Response.Redirect("ChaXunlb.aspx");
}
else
{
Response.Redirect("Cuowts.aspx");
}
}