RE: Dynamic settings entries with Application Settings.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • Re: Dynamic settings entries with Application Settings.
    ... my own settings class from scratch or 2)I can derive a class that does ... cause the application to restart, and you will lose all session, cache and ... But this code is only good when all the settings entries ... And I have to modify the class itself ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: filesystem permissions using dump on live filesystem
    ... >nevermind. ... Why must you -SIGHUP a daemon after ... changing its configuration file? ... "you have to restart your computer ...
    (freebsd-questions)
  • Re: [GNOME3] Gain vertical space
    ... installing any extension): ... the default GNOME Shell theme is Adwaita. ... the more interesting sections of this configuration file is: ... You are suggesting to modify a system file, is there any way to do ...
    (GNOME)
  • Re: Question about LaTeX...
    ... have a look to the configuration file `/etc/texmf/texmf.cnf', ... HOMETEXMF ... (you may have to modify some other stuff as well [I did it a long time ago). ... > How can I add a new class to the path where the latex command ...
    (Debian-User)
  • Re: Xserver reinstallation
    ... "Backup your configuration file ... Just copy the xorg.conf_backup back to xorg.conf and restart your ...
    (alt.os.linux)