no save
Assistance
Achat
News

Forum | programmation
[java]fichier .properties
javaclipse, le lun. 29 janv. 2007 à 11:25:00
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


javaclipse
janv. 07
Suivant
REPONSES
javaclipse
janv. 07
javaclipse
janv. 07
arth
janv. 07
arth
janv. 07
javaclipse
janv. 07
captainIgloo
janv. 08
zbandaklouch
18 avr.
Version Web
Réalisé par RedShift
no save