473,473 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save value in configuration file

I want to store some values so that the application can read from a file,
eg. ini file, configuration file.
If I add a Application Configuration File, to store the name of files:

key = "sales"
value = "sales.ini"

key = "account"
value = "account.ini"

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

</configuration>

So if my application is processing sales transactions, I read the key
"sales" to fetch the name of the ini file "sales.ini".

What should I put inside the
<configurationand
</configuration>
?


Sep 7 '06 #1
1 2036
The following works for me for asp.net 2.0:

<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="keyName" value="thevalue"/>
</appSettings>
</configuration>

Hope it helps.

Alan T wrote:
I want to store some values so that the application can read from a file,
eg. ini file, configuration file.
If I add a Application Configuration File, to store the name of files:

key = "sales"
value = "sales.ini"

key = "account"
value = "account.ini"

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

</configuration>

So if my application is processing sales transactions, I read the key
"sales" to fetch the name of the ini file "sales.ini".

What should I put inside the
<configurationand
</configuration>
?
Sep 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DraguVaso | last post by:
Hi, I found some examples for storing the FormSettings of a Form in an XML-file, but none of these could match my criteria: What I am looking for is the possibility to save the FormSettings of...
0
by: Andrzej Kaczmarczyk | last post by:
Hello, I am having troubles saving configuration file. I did the folloing: inherited from ConfigurationSection, ConfigurationCollection, ConfigurationElement to define my own element in...
0
by: ssg31415926 | last post by:
I've been trying to save a hashtable in an Application Settings file. I need to save settings for each tabPage on a form. Trouble is, the number of tabPages is determined at runtime, so I can't...
0
by: SR | last post by:
I am trying to use the Configuration object provided with the .NET 2.0 framework. I see that when I call the Save function it does update the <application>.exe.config file. However, when I close...
1
by: Shannon Richards | last post by:
Hello All: I have implemented a custom configuration section in my app.config file as follows: <configSections> <section name="AdminUIConfig" type="TestMgr.UIConfigSection,TestMgr"/>...
0
by: =?Utf-8?B?Qy4gSHVnaGVz?= | last post by:
Hello, I have a .net 2.0 application using a 'Settings.settings' configuration file to store application settings. The settings are modified at runtime and stored when the user exits the...
9
by: Antonio Ooi | last post by:
Hi, I have the following appSettings in my app.config file: <appSettings> <!-- Some comments here --> <add key="MyKey1" value="1"/>
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi, thanks, mister The code string rutaConfig = tbRutaConfigServicioBase.Text; '// Map to the application configuration file. ExeConfigurationFileMap configFile = New...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi misters, I have an app.config (UTF-8 format file). I create an application winforms for changes and save configuration programatically. When I save changes the format file changes to ANSI ...
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
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...
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...
1
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...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.