Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner; // I use scanner because it's command line.
- public class Login {
- public void run() {
- Scanner scan = new Scanner (new File("the\\dir\\myFile.extension"));
- Scanner keyboard = new Scanner (System.in);
- String user = scan.nextLine();
- String pass = scan.nextLine(); // looks at selected file in scan
- String inpUser = keyboard.nextLine();
- String inpPass = keyboard.nextLine(); // gets input from user
- if (inpUser.equals(user) && inpPass.equals(pass)) {
- System.out.print("your login message");
- } else {
- System.out.print("your error message");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement