473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

properties file

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
7 2578
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Paul | last post by:
Hello, I've been reading up on security in Java Applets and whilst I understand the concept, I can't successfully get my applet to read a file on my local machine. I discovered from...
3
by: Lauren Quantrell | last post by:
I'd like to use my Access 2K application to write some text in the file properties of a Windows file. The properties I'm talking about are the properties you see whn you right click on a Windows...
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
2
by: ironwall22z | last post by:
My goal is to write a program in C# that will take the Artist and Title of an MP3 file and change the name of the file to a concatenated combination of the two. In order to do this, I am trying to...
2
by: ywchan | last post by:
I want to access and modify the following file properties 1. when you open an application e.g. word / acrobat reader, those information in file -> properties. 2. when you right click the file,...
5
by: mike | last post by:
Hi, I have been playing with VB.NET/C# for getting some general properties of a fileinfo object. However, FileInfo object does not seem to expose some of the basic properties like TYPE that used...
1
by: gdgass | last post by:
Hi, I'm in the process of developing an app to scan and archive photos based upon the EXIF/Photo Keyword property. One of the requirements is that the Photo's keywords be editable via Digital...
2
by: Jan Eliasen | last post by:
Hi I am having some problems reading configuration values from a configuration file, using C# 2.0. I have programmed a Windows Service, and this part goes well - it runs nicely. Now, the...
1
by: sunnyluthra1 | last post by:
Hi Everyone, I am working on a piece of code, that displays the properties(Name, Datatype, size & Description) of the table in the database. Now I want to further Enhance the code. I Have created...
2
by: =?Utf-8?B?QXJ0?= | last post by:
I need to go through a folder and all of its subfolders and collect the Title, Comments, Keywords and a few other items. These are items that you see when you select a file in the Windows explorer...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.