Friday, March 13, 2009
How to update settings in a .Net App.config file.
It is sometimes very handy to be able to upate a value in a config file from within the program.
Here is how:
Configuration config
=
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings[
"DailySerialNumber"
].Value
=
this
.serialNumber.ToString(); config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection(
"appSettings"
);
Friday, March 13, 2009 10:32:52 AM (GMT Standard Time, UTC+00:00)
Comments [0]
-
.Net
|
C#
|
Development
Comments are closed.
Navigation
Home
Wiki
DevShop
Categories
.Net
Agile
C#
Development
DevShop
Future
HTC
Mobile
Software
Spb Mobile Shell
Tablet
tflTubeStatus
TyTN II
Video
WPF
XAML
Archive
<
March 2010
>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
Blogroll
Dave Winer
Jeff Sandquist
Robert Scoble
Scott Hanselman
SilverCode Solutions Ltd
4 Maple Close
Brentwood
Essex
UK
CM13 2EA
Phone: 0845 0557260
© Copyright 2010
SilverCode Solutions Ltd
Sign In
Statistics
Total Posts: 16
This Year: 4
This Month: 1
This Week: 1
Comments: 13