大神求解

你今天真美 2020-08-08 08:12:54
...全文
2521 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ASCII0000 2020-08-09
  • 打赏
  • 举报
回复
File file = new File("lyingFileRead.txt"); // 录入数据 FileOutputStream out = new FileOutputStream(file); String str = "张三,123456"; out.write(str.getBytes()); out.close(); // 读取数据 FileInputStream in = new FileInputStream(file); InputStreamReader reader = new InputStreamReader(in); BufferedReader br = new BufferedReader(reader); String line = ""; if ((line = br.readLine()) != null) { System.out.print("输入: "); Scanner input = new Scanner(System.in); String data = input.nextLine(); // 拆分数据 String username = line.split(",")[0]; String password = line.split(",")[1]; String data_name = data.split(" ")[0]; String data_password = data.split(" ")[1]; if (username.equals(data_name) && password.equals(data_password)) { System.out.println("欢迎登录"); } else { System.out.println("用户名或密码错误"); } input.close(); }
Kotlin小菜鸟 2020-08-09
  • 打赏
  • 举报
回复
c语言还是java
Kotlin小菜鸟 2020-08-09
  • 打赏
  • 举报
回复
c主要还是什么
你今天真美 2020-08-09
  • 打赏
  • 举报
回复
引用 1 楼 我的浪漫与极端的回复:
你是需要帮你写完全部的代码吗
对的,麻烦了

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧