public static void main(String[] args) {
String username="admin";
String password ="admin";
User user = new User(username,password);
//user.setUsername("admin");
//user.setPassword("admin");
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 3; i++) {
System.out.println("请输入用户名:");
String name = sc.nextLine();
System.out.println("请输入用户密码:");
String pwd = sc.nextLine();
if (user.IsLogin(name, pwd)) {
System.out.println("登陆成功");
break;
}else{
if (i==2){
System.out.println("用户名和密码输出错误3次,已锁定用户");
}else
{
System.out.println("用户密码或用户名错误,剩余" + (2-i) + "次数");
}
}