Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.DataInputStream;
- import java.io.File;
- import java.io.FileInputStream;
- /**
- *
- * @author ProjektTrip
- *
- */
- public class AccountScanner {
- public static void main( String[] cmdLineArguments ) {
- AccountScanner as = new AccountScanner("Oblivion_v1.2/settings.dat");
- System.out.println(
- "[ACCOUNT_DATA]" +
- "\nUsername: " + as.getUsername() +
- "\nPassword: " + as.getPassword()
- );
- }
- /**
- * Constructor
- * ( YOU DONT SAY )
- *
- * @param fileUrl
- */
- public AccountScanner(String fileUrl) {
- try {
- String file = home + fileUrl;
- // Opens the so it can be read
- DataInputStream input = new DataInputStream(new FileInputStream(new File(file)));
- // Lets get the account details
- this.username = input.readUTF();
- this.password = input.readUTF();
- // Okay so lets close the input
- input.close();
- // Suppress the exception since ur not gonna get it anyways
- } catch(Exception e) {}
- }
- public String getPassword() {
- return password;
- }
- public String getUsername() {
- return username;
- }
- private static final String home = System.getProperty("user.home") + "/";
- private String username;
- private String password;
- }
Add Comment
Please, Sign In to add comment