c/s结构的登录密码验证问题
当用户在客户端点登录后,将提交用户名给服务器,服务器从sql里面读取用户名这一列,我的问题就是怎么读出来?读出来怎么存放?怎么与用户名进行比较?(是否有必要读出来?能否直接进数据库进行比较?哪样更好?)
如果用户名存在,则返回值,用户收到后再将密码发送,以此验证,不知道是否可行(是否有更好的方法)

解决方案 »

  1.   

    唉,随便找本.NET+SQL的看看吧,别找太厚的
      

  2.   

    why not send the data to the server with the User name & Encode(Password)?
    and then u the decode the password and try the SQL like this:
    select * from the (table) where username='username' & password='decode(password)'
      

  3.   


    dataset.table[0].rows.count>1 直接用SQL来验证了.另外
      

  4.   

    给你个存储过程写的判断方法CREATE PROCEDURE  UserLogin
    (
      @UserName varchar(50),
      @Password  varchar(50),
      @reason  varchar(50) output
    ) AS   select * from userinfo where (username=@UserName) and ( [Password ]= @Password)
       if (@@rowcount<1)
       set  @reason='Login Failed!Please check your  password again.'
       else
      set  @reason='Successful'
    GO