Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Scanner;
- import java.util.Vector;
- public class MedicalOrganizer {
- public static void main(String[] args) {
- Scanner get = new Scanner (System.in);
- Vector strUser, strPassword;
- String strLoginU, strLoginP;
- strUser = new Vector();
- strPassword = new Vector();
- System.out.println ("Login:\n\n\n");
- System.out.print ("Username: ");
- strLoginU = get.next();
- System.out.print ("Password: ");
- strLoginP = get.next();
- int i = 0;
- try {
- DataInputStream uin = new DataInputStream(new FileInputStream("Usernames.ini"));
- DataInputStream pin = new DataInputStream(new FileInputStream("Passwords.ini"));
- while ((uin.available() != 0) && (pin.available() != 0)) {
- strUser.addElement(uin.readLine());
- strPassword.addElement(pin.readLine());
- if ((strLoginU == strUser.elementAt(i)) && (strLoginP == strPassword.elementAt(i))) {
- System.out.println("Access granted.");
- }
- i++;
- }
- } catch (Exception e) {
- System.err.println ("error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement