473,378 Members | 1,721 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,378 software developers and data experts.

Set value to app.config

I usualy get value form app.config with
System.Configuration.AppSettingsReader...
and it's very easy

Is there a way to Set value to app.config

Here i have a solution with Next node (System.Xml.XmlDocument) but
maybe so code are more clean...

thx for help

Nov 21 '05 #1
3 1711
I guess this (XML DOM) is the best way to write to the app.config...

However, I don't think it's a good practice to write to this file as it was
only intended for storing properties. Maybe you could consider the registry
or a xml file?

--
http://www.khsw-be.net
"ucasesoftware" wrote:
I usualy get value form app.config with
System.Configuration.AppSettingsReader...
and it's very easy

Is there a way to Set value to app.config

Here i have a solution with Next node (System.Xml.XmlDocument) but
maybe so code are more clean...

thx for help

Nov 21 '05 #2
"ucasesoftware" <uc***********@hotmail.fr> schrieb:
I usualy get value form app.config with
System.Configuration.AppSettingsReader...
and it's very easy

Is there a way to Set value to app.config


Note that config files are not intended for storing user preferences. Thus
it's very unlikely that changes to config files are made after setup. You
may want to take a look at the article below which contains links to
articles and samples which demonstrate how to persis user preferences:

Storing and loading user preferences
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
thx a lot

Nov 21 '05 #4

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

Similar topics

5
by: Robert Oschler | last post by:
I am converting a Perl script over to "C" for a potential open source project. I need some open source "C" code that will give me the same functionality of a Perl Style associative array: ...
3
by: Frankie | last post by:
I'm writing a small utility app (C# Windows forms) used to create new ASP.NET Web sites. This utility needs to be able to change existing values in an existing Web.config. Please note: I do NOT...
2
by: MisConFit8 | last post by:
My question is this - is it possible to set a standard value in the web.config file and change it later based on conditions? Why, you might ask? I am building a web based application for...
5
by: Alberto | last post by:
I need to modify a value in the app.config file with this code: System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); string key =...
2
by: mahesh.anjani | last post by:
hi i have stored my connction string in web.config as we do usually. code of web.confing is given below. check the password field contain "&" character. now when i run my application it gives...
3
by: prabu.girirajan | last post by:
Hi, I have a web application which internally calls certain web methods of a web service. This web service has a interop to ATL COM Component and that ATL component calls a .NET assembly. I would...
2
by: Lucas Malor | last post by:
Hello all. I'm trying to do a little script. Simply I want to make a list of all options with them default values. If the option is not specified in the command line, the script must try to read it...
3
by: Mark Rae | last post by:
Hi, Apologies if this is a stupid question, but it's late... I have a C# 2 WinForms project called RTES, and I'm trying to add new key/value pairs to the appSettings section of its config...
3
by: Eve DW | last post by:
Here's my App.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="customers"> <section name="test1" ...
1
by: =?Utf-8?B?c3B1cnZpYQ==?= | last post by:
I have a simple C# VS 2005 console application that contains a class and an app.config file. My app.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key =...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.