Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public static void UserConfigLoad() {
  2. try{
  3. Properties p = new Properties();
  4. p.load(new FileInputStream("user.ini"));
  5. myUsername = p.getProperty("Username");
  6. myPassword = p.getProperty("Password");
  7. fixed = p.getProperty("FixedScreen");
  8. }
  9. catch (Exception e) {
  10. System.out.println(e);
  11. }
  12. }
  13.  
  14. public void UserConfigSave() {
  15. try{
  16. Properties p = new Properties();
  17. p.load(new FileInputStream("user.ini"));
  18. p.put("Username",""+ myUsername +"");
  19. p.put("Password",""+ myPassword +"");
  20. p.put("FixedScreen",""+ fixed +"");
  21. FileOutputStream out = new FileOutputStream("user.ini");
  22. p.save(out, "/* Server Info Updated */");
  23. }
  24. catch (Exception e) {
  25. System.out.println(e);
  26. }
  27. }
  28.  
  29. Fixedscreen is a boolean so its either true or false.
  30. Username is a string.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement