asp.net登录代码

来源:百度知道 编辑:UC知道 时间:2024/05/15 22:23:56
asp.net登录代码
我用的是vb.net 2005
数据库用的是sql express

protected void lkbtLogin_Click(object sender, System.EventArgs e)
{
if(txtVerifyNum.Text.Trim() != Session["SessionAppendNumber"].ToString())
{
oprtb.AlertMsg("输入的验证码错误",Page);
return;
}

DataSet ds = new DataSet();
string sql = "select UserID,Name,DepartID,CompanyID,";
sql = sql+"(select Name from Depart where ((DepartID=UserList.DepartID) and ( CompanyID=UserList.CompanyID))) as DepartName,";
sql = sql+"(select Name from Company where (CompanyID=UserList.CompanyID)) as CompanyName ";
sql = sql+"from UserList where UserID='" + txtUserID.Text.Trim() +"' and Password='" + Encrypt.EncryptPwd(txtPassword.Text.Trim(),"MD5") + "' and Cancellation = 0";

//string sql = "select * from UserList where UserID='" + txtUserID.Text.Trim() +"' and Password=&