Passing parameters best practice

T

tshad

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?

Thanks,

Tom
 
M

Marina Levit [MVP]

I think no matter what mechanism you use, you should have a front end
interface for the user to use. The user shouldn't have to dig into the
registry, or the config file of the application.

These various places have various degrees of security. If your parameters
don't need to be secure, then you could go either the registry route, or
app.config.

No matter what route you take, you will need to restart your windows service
to pick up the new configuration settings.
 
S

sloan

My preferred route these days is a custom configuration section/handler.

http://support.microsoft.com/kb/309045/EN-US/

After you do 1 or 2 of them (aka, get past the struggle part), they are
simple to write.

It gives you a true "object" at the end of the day to encapsulate your
values...instead of always getting the app/key/value.
It keeps the app.config file organized and neat also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top