|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Passing parameters best practiceI need to pass a few parameters to my Windows Service program. The end user
will be changing the parameters and settings should be saved. What is the best practice - use app.config - use .ini file - use Registry - write a Windows Application program and save the settings to database table should I trust the end user to modify registry, .config or .ini file?
Show quote
Hide quote
"tshad" <tscheider***@ftsolutions.com> wrote in message app.config, posssibly with a Windows Application to modify the app.config.news:eQuJp%239uGHA.4876@TK2MSFTNGP04.phx.gbl... >I need to pass a few parameters to my Windows Service program. The end user >will be changing the parameters and settings should be saved. > > What is the best practice > - use app.config > - use .ini file > - use Registry > - write a Windows Application program and save the settings to database > table > > should I trust the end user to modify registry, .config or .ini file? > David Yes app.config is the best place if this is machine specific. If the settings
are shared between multiple machines then a DB may make sense. Whatever be the option, you will anyway need a app interface for the user to maintain these parameters. Show quoteHide quote "tshad" wrote: > I need to pass a few parameters to my Windows Service program. The end user > will be changing the parameters and settings should be saved. > > What is the best practice > - use app.config > - use .ini file > - use Registry > - write a Windows Application program and save the settings to database > table > > should I trust the end user to modify registry, .config or .ini file? > > > tshad wrote:
> I need to pass a few parameters to my Windows Service program. The end user Then they'll need a program to help them do it.> will be changing the parameters and settings should be saved. > What is the best practice Not considered "writeable" in .Net applications (at least as far as > - use app.config VS'2003). > - use .ini file Or an XML configuration file that you can interrogate using XPath.> - use Registry Not really recommended anymore - the stupid clogged with too much other rubbish, it's impossible to back-up reliably and is often protected from casual (i.e. user) perusal. > - write a Windows Application program and save the settings to database [Big!] Yes to having an editing application.> table Where the data gets stored depends on lots of things. For example, will the user be on the same machine as the Service? If not, most file-based solutions (including the Registry, which is just a file) go straight out the window. > should I trust the end user to modify registry, .config or .ini file? No, definitely not. Indeed, most of them (in commercial organisations) will be actively prevented from hacking around the Registry. HTH, Phill W. tshad,
What I do is write a Windows Application program that updates the Window's Services app.config file. I have the Windows Application restart the service so that it sees the updated config file. Currently I am using System.Xml to update the config file, however I'm thinking the new Configuration namespace in .NET 2.0 (VS 2005) will simplify changing the config file. FWIW: The new Configuration namespace in .NET 2.0 definitely simplifies leveraging the config file! -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "tshad" <tscheider***@ftsolutions.com> wrote in message news:eQuJp%239uGHA.4876@TK2MSFTNGP04.phx.gbl... |I need to pass a few parameters to my Windows Service program. The end user | will be changing the parameters and settings should be saved. | | What is the best practice | - use app.config | - use .ini file | - use Registry | - write a Windows Application program and save the settings to database | table | | should I trust the end user to modify registry, .config or .ini file? | |
MessageBox in Validating event cancels subsequent events
Referencing Controls created at run time. Dataset End all running code of .dll Class item not accessible because it's private... but it's not? Drawstring question... Description of Function How do I send null values to an integer type variable? Writing to a file opened in another class Multi-level TreeNode storing? |
|||||||||||||||||||||||