By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,639 Members | 1,988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,639 IT Pros & Developers. It's quick & easy.

properties file

P: n/a
I need something like java.util.Properties class...
I want to store properties in a text file and to get at runtime.

Example in java:

text file
------
propertieName1=propertieValue1
propertieName2=propertieValue2
propertieName3=propertieValue3
------

So, using Properties class I can get the properties by name.
And I can change the properties values without need to compile the
aplication again.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi,

you can store you properties in your app.config file:

<configuration>
<appSettings>
<add key="PropertyName" value="value"/>
</appSettings>
</configuration>
and get them via:

string s =
System.Configuration.ConfigurationSettings.AppSett ings["PropertyName"];

I need something like java.util.Properties class...
I want to store properties in a text file and to get at runtime.

Example in java:

text file
------
propertieName1=propertieValue1
propertieName2=propertieValue2
propertieName3=propertieValue3
------

So, using Properties class I can get the properties by name.
And I can change the properties values without need to compile the
aplication again.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #2

P: n/a
Hi,

The configuration applications block might be usefull :
http://msdn.microsoft.com/library/de...tml/config.asp

Regards,
Bart

--
http://www.xenopz.com
"ffmelo" <zo**@top.com-dot-br.no-spam.invalid> wrote in message
news:42**********@127.0.0.1...
I need something like java.util.Properties class...
I want to store properties in a text file and to get at runtime.

Example in java:

text file
------
propertieName1=propertieValue1
propertieName2=propertieValue2
propertieName3=propertieValue3
------

So, using Properties class I can get the properties by name.
And I can change the properties values without need to compile the
aplication again.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #3

P: n/a
if I change the app.config need do I compile the application again?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #4

P: n/a
thanks denny and bart... I used the app.config and the problem was
resolved.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #5

P: n/a
ffmelo wrote:
if I change the app.config need do I compile the application again?


Assuming you just changed values and not key names, no - you just need
to restart the application for those changes to take effect.

Nov 16 '05 #6

P: n/a
If you are talking about the file app.config that visual studio uses then you *will* need to perform a "build" as this is the point at which the app.config is copied with the correct name to the target directory.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

ffmelo wrote:
if I change the app.config need do I compile the application again?


Assuming you just changed values and not key names, no - you just need
to restart the application for those changes to take effect.

Nov 16 '05 #7

P: n/a
Ah - good point. I didn't notice the '.' and thought he said app
config, meaning just the config file created from web.config or
app.config.

Sorry!
Clint

Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.