感谢您的关注.
我创建了一个程序,我正在使用登录表单和注册表单.一旦用户注册他们的电子邮件,他们的密码将被保存到submit.txt.然后他们将返回登录表单并输入保存到的电子邮件和密码submit.txt.
在我的代码中,我使用Register文件的写文件和Login Form的Read文件.但是,它不起作用.我在用于读取文件的代码中知道我的问题.你可以帮我实现吗?
非常感谢你的帮助.
if (checkPassword(usern, hash)) {
System.out.println("Logged in!");
ChooseWindow ptb = new ChooseWindow();
ptb.setVisible(true);
LoginWindow.this.dispose();
} else {
System.out.println("Wrong password");
}
public boolean checkPassword(String username, String pass) {
try {
FileReader inFile = new FileReader("/users/Ender/Desktop/GetUser/submit.txt");
BufferedReader inStream = new BufferedReader(inFile);
String inString;
while ((inString = inStream.readLine()) != null) {}
inStream.close();
}catch (IOException e) {
e.printStackTrace();
}
return false;
}
Run Code Online (Sandbox Code Playgroud) 我是 MongoDB 的新手。我正在尝试创建一个包含 10,000 条数据的数据库。数据将包含“用户名”和“生日”。
我想用随机用户名和生日创建 10,000 个数据。我们有创建这种数据库的最快方法吗?
非常感谢你的帮助!