Hi Franco ;
String fileName="wscnt.properties";
FileInputStream fis = new FileInputStream(fileName);
Properties prop=new Properties();
prop.load(fis);
fis.close();
prop.setProperty("contatore","0000101");
FileOutputStream fos = new FileOutputStream(fileName);
prop.store(fos,"");
fos.close();
try it it will solve ur problem
ffellico@inwind.it - 01 Jan 2006 10:00 GMT
Thank you sherazi. Naturally it work!
Before I was uncertain about the statement:
prop.store(fos,"");
because I was dubious on what was necessary to put in the second
parameter!
Happy new year. Franco.
Roedy Green - 02 Jan 2006 16:15 GMT
> prop.store(fos,"");
Beware. This method scrambled the order, turfs you comments and blank
lines. See http://mindprod.com/jgloss/properties.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
On 31 Dec 2005 00:17:46 -0800, "ffellico@inwind.it"
<ffellico@inwind.it> wrote, quoted or indirectly quoted someone who
said :
>I like to read the value of "contatore" wich initially is 0000100
>
[quoted text clipped - 7 lines]
>
>Thank you and Happy new year. Franco
You load the properties, then you put a new value for a property, then
you save the properties as a whole. There is no way to just modify a
little piece of the file.
See http://mindprod.com/jgloss/properties.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.