1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
public class READ {
****public READ (){
********Boolean test = textRead("zero.txt","usera");
****}
*****
****public Boolean textRead(String fileName,String login) {
********String line, fields[];
********Boolean connection;
********connection=false;
********try {
************connection=false;
************BufferedReader reader = new BufferedReader(new FileReader(fileName));
************System.out.println("ENTRE DANS LE TRY");
************while ((line = reader.readLine()) != null) {
****************fields = line.split(";");
****************String login2 = fields[0];
****************System.out.println("LOGIN2 = "+login2+"");
*****************
****************if(login.equals(login2)){
********************connection=true;
********************break;
****************}
************}
************reader.close();
************return(connection);
********} catch (IOException e) {
************System.err.println(e.getMessage());
********}
********return(connection);
****}
*
} |
Partager