比如有一个access数据库,表名是admin,里面有name,password两个字段名.在后台如何实现简单的登录功能?谢谢!!

解决方案 »

  1.   

    search use the keywords:httpwebRequest/webClient
      

  2.   


    大概思路我会,但是具体实现有个别地方不知怎么去实现,还望高手指点.比如说
    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);
    下面怎么写?
      

  3.   

    最后你用DataReader读出来,把值赋给Session接下来用Session来判断权限
      

  4.   

           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
            {
            //提示失败
            }
      

  5.   

    DataSet ds = new DataSet(); 
    da.Fill(ds);
    if(ds.Table[0].Rows.Count==0)
    {
    //提示不存在用户
    }
    else
    {
    //登陆成功,保存用户信息,跳转到主页面
    }