B
BinGast
Gast
Hallo,
wie kann ich unter der Konsole eine Passwortabfrage realisieren?
Danke schon im voraus
wie kann ich unter der Konsole eine Passwortabfrage realisieren?
Danke schon im voraus
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
mport java.io.*;
import java.awt.*;
public class PwdConsole {
public static void main(String[] args) throws Exception {
ConsoleEraser consoleEraser = new ConsoleEraser();
System.out.print("Password? ");
BufferedReader stdin = new BufferedReader(new
InputStreamReader(System.in));
consoleEraser.start();
String pass = stdin.readLine();
consoleEraser.halt();
System.out.print("\b");
System.out.println("Password: '" + pass + "'");
}
}
class ConsoleEraser extends Thread {
private boolean running = true;
public void run() {
while (running) {
System.out.print("\b ");
}
}
public synchronized void halt() {
running = false;
}
}
Pulvertoastman hat gesagt.:Das Einsetzen von Decompilern um ein Programm zu nutzen setzt schon einiges an krimineller Energie voraus.