yngvi
asked on
Using ini files in Java
I want my program to read a ini file when it starts up. It looks like this :
[Settings #1]
connection=192.13.5.4
Port=4658
[Settings #2]
conneciton=198.15.4.86
port=5844
I want variables to get information from the ini file.
well you get the picture. Is there any easy way to do this ?
[Settings #1]
connection=192.13.5.4
Port=4658
[Settings #2]
conneciton=198.15.4.86
port=5844
I want variables to get information from the ini file.
well you get the picture. Is there any easy way to do this ?
else use manual parsing,
heyhey,
ur Email ID has changed? Got a bouncer now.
wanted to send a nice link to you,send me a mail at my profile account.
heyhey,
ur Email ID has changed? Got a bouncer now.
wanted to send a nice link to you,send me a mail at my profile account.
1Define a property file which contains
connection=198.15.4.86
port=5844
and save it to any filename (e.g. app.properties)
and to retrieve the value. Do this
Properties props = new Properties()
FileInputStream fis = new FileInputStream("app.prope rties");
props.load(fis);
String connection = props.getProperty("connect ion");
String port = props.getProperty("port");
connection=198.15.4.86
port=5844
and save it to any filename (e.g. app.properties)
and to retrieve the value. Do this
Properties props = new Properties()
FileInputStream fis = new FileInputStream("app.prope
props.load(fis);
String connection = props.getProperty("connect
String port = props.getProperty("port");
heyhey_@iname.com is working - I receive a lot of e-mails there.
heyhey@nettaxi.com is another option.
heyhey@nettaxi.com is another option.
I wrote a class to read ini file, if you want I can send to you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> [Settings #1]
you can use java.util.Properties