my dog learned polymorphism
The moose likes I/O and Streams and the fly likes how to write into an ini file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "how to write into an ini file" Watch "how to write into an ini file" New topic

how to write into an ini file

keshav reddy

Joined: May 11, 2007
Posts: 13

In a project I have a requirement of writing into ini (windows specific) files. Can you please give me some details how i can write the new "sectionname", "key","value" into an ini file.
I think by using setproperty method we can update the value of existing key, but how can I write the new key- value in an ini file.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

You won't be the first person to have that requirement, or even the ten-thousandth person. I suggest googling for somebody who has already done an ini-maintainer in Java.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
That's what the ini4j library does.
I agree. Here's the link:
subject: how to write into an ini file
It's not a secret anymore!