473,624 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

properties file

I need something like java.util.Prope rties 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 2595
Hi,

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

<configuratio n>
<appSettings>
<add key="PropertyNa me" value="value"/>
</appSettings>
</configuration>
and get them via:

string s =
System.Configur ation.Configura tionSettings.Ap pSettings["PropertyNa me"];

I need something like java.util.Prope rties 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.Prope rties 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
11448
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 http://java.sun.com/sfaq/#read: ----- Sun's appletviewer allows applets to read files that are named on the access control list for reading. The access control list for reading is null by default, in the JDK. You can allow applets to read directories or files...
3
4393
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 file and then click on Properites, then the Summary tab. I want to be able to modify the Subject line and the Comments line in particular. I'm hoping someone can tell me how to do this. Thanks, lq
10
7360
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 Windows.Forms.UserControl in a COM environment, i.e. I want to host that control in a COM host. So far, so good, I can host it, but I can not reach the parent COM object from the control (Parent property is null :( ). I have stopped the control in the...
2
5778
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 find the correct object or property to implement. I have found information about the file name itself and the extensions (among other things), but not specific details about an individual file. In case what I am explaining may seem somewhat...
2
4806
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, choose properties, the information stored in summary thanks
5
3795
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 to be available in "FileSystemObject" of ScriptingLibrary. For example the "TYPE" property should return "Text Document" or "Microsoft Office Document" or "Visual Studio Code File" and so on. similar to the properties displayed by Properties...
1
2607
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 Image Suite 2006 Library . Then the app will look for a specific keyword, change the keyword to indicate the photo has been scanned and move a copy to the archive area.
2
3619
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 Windows Service must call a Web Service every now and then. I have added the web reference, and made it dynamic, so I can change the
1
3693
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 a form in MS Access, on that form, I have 2 buttons & a text box. One button is to select a mdb file, whom properties i want to display. Second button then stores that properties in a Excel file. when I open the file using first button, the path of...
2
2834
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 and look in Properties, Summary. In VBA I'm able to get at this informatio using Dsofile.dll -- found on a MS site somewhere. It looks like I'd like to use My.Computer.FileSystem, but I can't seem to find out how to get what I need. I'd...
0
8249
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8179
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8633
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.