Credentials Test
This commit is contained in:
parent
763948e288
commit
6a02be9f2e
@ -1,19 +1,32 @@
|
|||||||
|
import java.io.InputStream;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Scanner s = new Scanner(System.in);
|
if(login(System.in)) {
|
||||||
System.out.print("Benutzername: ");
|
System.out.println("Hello World");
|
||||||
String login = s.next();
|
}
|
||||||
System.out.print("Passwort: ");
|
}
|
||||||
String passwort = s.next();
|
|
||||||
s.close();
|
|
||||||
|
|
||||||
Credentials cred = new Credentials(login, passwort);
|
public static boolean login(InputStream in) {
|
||||||
if (cred.valid()) {
|
Scanner s = new Scanner(in);
|
||||||
System.out.print("Hello World");
|
|
||||||
System.exit(0);
|
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
System.out.print("Benutzername: ");
|
||||||
|
String login = s.next();
|
||||||
|
System.out.print("Passwort: ");
|
||||||
|
String passwort = s.next();
|
||||||
|
|
||||||
|
Credentials cred = new Credentials(login, passwort);
|
||||||
|
|
||||||
|
if (cred.valid()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Du kommst hier nicht rein");
|
||||||
}
|
}
|
||||||
System.out.print("Du kommst hier nicht rein");
|
s.close();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user