Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String USER_DIR = "Users"
- public void saveUser(User user) {
- File userFile = File(USER_DIR + "\\" + cardnumber + ".txt");
- if (userFile.CanRead()) { }
- try{
- PrintWriter writer = new PrintWriter(new FileOutputStream(USER_DIR + "\\" + cardnumber + ".txt", false), "US-ASCII");
- writer.println(user.cardnumber + "-" + user.password + "-" + user.balance);
- writer.close();
- } catch (IOException e) {
- // do something
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement