Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2006

Tip: Looking for answers? Try searching our database.

Writing to the APP.CONFIG file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Cosmas - 12 Jan 2006 21:53 GMT
How would I write or update a key in a section of the APP.CONFIG or my
application's.EXE.CONFIG file?
Christopher Reed - 16 Jan 2006 02:08 GMT
Treat like an XML document.  Remember that you'll need to have modify rights
on the file.
Signature

Christopher A. Reed
"The oxen are slow, but the earth is patient."

> How would I write or update a key in a section of the APP.CONFIG or my
> application's.EXE.CONFIG file?
Kevin Spencer - 16 Jan 2006 03:01 GMT
This is only possible in .Net Framework 2.0.

You can use the ConfigurationElement.SerializeElement() method. The
IsReadOnly Property will inform you if the ConfigurationElement can be
modified.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

> How would I write or update a key in a section of the APP.CONFIG or my
> application's.EXE.CONFIG file?
Mary Chipman [MSFT] - 23 Jan 2006 16:44 GMT
As Christopher pointed out, you will need permissions on the
config.file. The new System.Configuration namespace contains new
classes for working with configuration files (using the
ConfigurationManager). It is best documented in the "Protected
Configuration" topics for ASP.NET apps, but can also be applied to
Windows apps. See also "Storing and Retrieving Connection Strings"
http://msdn2.microsoft.com/en-us/library/ms254494.aspx for some sample
code demonstrating reading and writing to the connectionStrings
section.

--Mary

>How would I write or update a key in a section of the APP.CONFIG or my
>application's.EXE.CONFIG file?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.