Bonjour,
j'ai généré un fichier .properties. J'ai inséré des valeurs dedans, maintenant il faut que je le gère. Le code ci-dessous devrait normalement me récupérer les valeurs de ce fichier .properties. Mais je récupère que la première valeur et en boucle. Pourtant normalement je lui donne le nom de ma première clé et je le fais passer à l'élément suivant. Pouvez-vous me dire svp si j'ai fais un pti oubli.
public static void main(String[] args) {
Properties prop = new Properties();
try {
prop.load(new FileInputStream("C:/Documents and Settings/LIVINFO/workspace/com.promotelec.exemple/src/promo_act.properties"));
/**Iterator it = prop.keySet().iterator();
while (it.hasNext()) {
String propertyName = (String) it.next();
String propertyValue = prop.getProperty(propertyName);
System.out.println(propertyValue);
}*/
Iterator it = prop.keySet().iterator();
while (it.hasNext()) {
String mesValeurs = prop.getProperty("catégorie");
System.out.println(mesValeurs);
}
} catch (Exception e) {
System.out.println("Erreur Exception" + e);
}
Merci d'avance. Configuration: Windows XP
Internet Explorer 7.0

