RE: Dynamic settings entries with Application Settings.
- From: Peter Bromberg [C# MVP] <pbromberg@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Jan 2007 17:12:00 -0800
You could certainly do this since the configuration file is well-formed XML.
The problem is that when you have modified and resaved this file, your
application will not automatically reload it unless it is restarted. If it is
an ASP.NET web app, and you modify the web.config (same concept) this will
cause the application to restart, and you will lose all session, cache and
application state.
Does that help?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Sin Jeong-hun" wrote:
I've read the "How to: Create Application Settings" article (http://.
msdn2.microsoft.com/en-us/library/ms171565.aspx) on the MSDN. It
looked fine. But this code is only good when all the settings entries
are defined at the compile time. And I have to modify the class itself
each and everytime I need more entries. So, is it impossible to get/
save dynamic entries?
I mean, instead of,
MyUserSettings.Background=color;
color=MyUserSettings.Background;
use this
MySettings["key"]=color;
color=MySettings["key"];
where "key" can be any string. If "key" doesn't exist, then a new
entry for "key" is created.
I could create my own class from scratch, but I just wonder if I could
utilize the already exsiting ApplicatoinSettingsBase class. Thank you.
- Follow-Ups:
- Re: Dynamic settings entries with Application Settings.
- From: Sin Jeong-hun
- Re: Dynamic settings entries with Application Settings.
- References:
- Dynamic settings entries with Application Settings.
- From: Sin Jeong-hun
- Dynamic settings entries with Application Settings.
- Prev by Date: Dynamic settings entries with Application Settings.
- Next by Date: Re: Menus and Toolbars [C# newbie]
- Previous by thread: Dynamic settings entries with Application Settings.
- Next by thread: Re: Dynamic settings entries with Application Settings.
- Index(es):
Relevant Pages
|