在后台如何实现简单的登录功能? 比如有一个access数据库,表名是admin,里面有name,password两个字段名.在后台如何实现简单的登录功能?谢谢!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 search use the keywords:httpwebRequest/webClient 大概思路我会,但是具体实现有个别地方不知怎么去实现,还望高手指点.比如说static OleDbConnection my_conn = DB.Getconn();string UserName=t1; string PassWord=t2;OleDbDataAdapter da = new OleDbDataAdapter("select * from Admin where name='" + UserName + "' and password='" + PassWord + "'", my_conn);下面怎么写? 最后你用DataReader读出来,把值赋给Session接下来用Session来判断权限 OleDbConnection my_conn = DB.Getconn(); SqlDataReader myDataReader = null; SqlCommand comm = new SqlCommand(strSql, my_conn); myDataReader = comm.ExecuteReader(); if (myDataReader.Read()) { Session["user"] = myDataReader["name"].ToString(); //跳转到管理平台 } else { //提示失败 } DataSet ds = new DataSet(); da.Fill(ds);if(ds.Table[0].Rows.Count==0){//提示不存在用户}else{//登陆成功,保存用户信息,跳转到主页面} 刚开始接触asp.net,请教个问题 表单验证Login控件只能重定向ASPX文件?? 在垃圾箱中超过30天未处理的短信系统将会自动删除 求二次换乘asp.net代码 请教个wsdl的问题 CSDN一样,多级的可以删除和添加的动态树 菜鸟急等 求解XSLT格式化问题! 传2个 变量这里应该 怎么写 急。在线等待解决办法。 添加的问题 使用UpdatePanel,弹出对话框的问题.
大概思路我会,但是具体实现有个别地方不知怎么去实现,还望高手指点.比如说
static OleDbConnection my_conn = DB.Getconn();
string UserName=t1;
string PassWord=t2;
OleDbDataAdapter da = new OleDbDataAdapter("select * from Admin where name='" + UserName + "' and password='" + PassWord + "'", my_conn);
下面怎么写?
SqlDataReader myDataReader = null;
SqlCommand comm = new SqlCommand(strSql, my_conn);
myDataReader = comm.ExecuteReader();
if (myDataReader.Read())
{
Session["user"] = myDataReader["name"].ToString();
//跳转到管理平台
}
else
{
//提示失败
}
da.Fill(ds);
if(ds.Table[0].Rows.Count==0)
{
//提示不存在用户
}
else
{
//登陆成功,保存用户信息,跳转到主页面
}