CodePudding user response:
String account="111111";String password="111111";
Map
String path="D: \ \ test. TXT".
The File File=new File (path);
BufferedReader bReader=new BufferedReader (new FileReader (file));
String String="";
String PC []=null;
The String key="";
String valuehttps://bbs.csdn.net/topics/="";
While ((string=bReader readLine ())!=null) {
PC=string. The split (", ");
Key=PC [0];
Value=https://bbs.csdn.net/topics/pc [1];
The map. The put (key, value);
}
Set
For (String string2: keySet) {
System. The out. Println (string2);//account
System. The out. Println (map. Get (string2));//password
If (the equals (string2) & amp; & Password. Equals (map. Get (string2))) {
System. The out. Println (" password is right ");
break;
} else {
System. The out. Println (" password error ");
}
}
BReader. Close ();
//TXT text, password and account between commas in English
CodePudding user response:
String account="111111";String password="111111";
Map
String path="D: \ \ test. TXT".
The File File=new File (path);
BufferedReader bReader=new BufferedReader (new FileReader (file));
String String="";
String PC []=null;
The String key="";
String valuehttps://bbs.csdn.net/topics/="";
@ SuppressWarnings (" unused ")
boolean result=false;
While ((string=bReader readLine ())!=null) {
PC=string. The split (", ");
Key=PC [0];
Value=https://bbs.csdn.net/topics/pc [1];
The map. The put (key, value);
}
Set
For (String string2: keySet) {
System. The out. Println (string2);//account
System. The out. Println (map. Get (string2));//password
If (the equals (string2) & amp; & Password. Equals (map. Get (string2))) {
Result=true;
break;
}
}
If (result=false) {
System. The out. Println (" password error ");
} else {
System. The out. Println (" password is right ");
}
BReader. Close ();
Just that a bit of a problem, change it
CodePudding user response:
CodePudding user response:
Learning is very good,CodePudding user response:
Kiss me no matter lose don't lose the password directly success?? Don't act for thanCodePudding user response:
3 # more problemsThe==comparison
=assignment