Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Telnet server returning strange characters
- Client connected with the IP /127.0.0.1
- Client /127.0.0.1 has entered the username ÿûÿû ÿûÿû'ÿýÿûÿýdcole.
- Socket client = serv.accept();
- InetAddress clientip = client.getInetAddress();
- out("Client connected with the IP " + clientip);
- InputStream clientinput = client.getInputStream();
- OutputStream clientoutput = client.getOutputStream();
- Scanner in = new Scanner(clientinput);
- clientoutput.write("Please enter your username: ".getBytes());
- String username = in.nextLine();
- out("Client " + clientip + " has entered the username " + username + ".");
- String pass = "Please enter the password for " + username + ": ";
- clientoutput.write(pass.getBytes());
- String password = in.nextLine();
- if (username.equals("dcole") && password.equals("test")) {
- clientoutput.write("rnCorrect password!".getBytes());
- } else {
- clientoutput.write("rnIncorrect password!".getBytes());
- }
Add Comment
Please, Sign In to add comment