public boolean UserLogin(User u) { userDAO userDao = new userDAO(); ArrayList<User> list = userDao.getUser(); int i= 0; if (list != null && list.size() > 0) { for (User c : list) { if (c.getUsername().equals(u.getUsername()) && c.getPassword().equals(u.getPassword())) { i=1;break; }else i=0; } } if(i==1){ return true; }else if(i==0){ return false; } }
添加回答
举报
0/150
提交
取消