Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sas.kacper.itemsapp;
- import java.lang.Boolean;
- import java.lang.String;
- import java.io.FileReader;
- import java.io.IOException;
- import java.io.BufferedReader;
- import java.io.FileNotFoundException;
- public class LoginAuthenticator {
- public static Boolean checkLogin(String Login, String hashPass) {
- BufferedReader strFile = null;
- try {
- strFile = new BufferedReader(new FileReader("input.txt"));
- } catch(FileNotFoundException e) {
- e.printStackTrace();
- }
- Boolean bFound = false;
- String sLine = null;
- try {
- while((sLine = strFile.readLine()) != null) {
- String[] data = sLine.split(":");
- if(data[0].equals(Login)) {
- if(data[1].equals(hashPass)) {
- return true;
- }
- }
- }
- } catch(IOException e) {
- e.printStackTrace();
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement