当我运行这个程序时,我输入用户名 as"dcole"
和密码"test"
,但是当我输入它们时,它们返回"ÿûÿû ÿûÿû'ÿýÿûÿýdcole"
and "ÿþÿþ ÿþÿþ'ÿütest"
。这是代码:
clientoutput.write("Please enter your username: ".getBytes("UTF-8"));
clientoutput.flush();
String username = clientinput.readLine();
out("Client " + clientip + " logged in as " + username);
String askforpass = "Please enter the password for " + username + ": ";
clientoutput.write(askforpass.getBytes());
clientoutput.flush();
String password = clientinput.readLine();
out(password);
安慰:
Client connected with the IP /127.0.0.1
Client /127.0.0.1 logged in as ÿûÿû ÿûÿû'ÿýÿûÿýdcole ÿþÿþ ÿþÿþ'ÿütest