473,395 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Passing parameters best practice

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
Aug 9 '06 #1
3 1277
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.

"tshad" <ts**********@ftsolutions.comwrote in message
news:uM***************@TK2MSFTNGP06.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?

Thanks,

Tom

Aug 9 '06 #2

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.


"tshad" <ts**********@ftsolutions.comwrote in message
news:uM***************@TK2MSFTNGP06.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?

Thanks,

Tom


Aug 9 '06 #3

Please do not cross post.

http://groups.google.com/group/micro...f8e0ec80b5458e

http://groups.google.com/group/micro...dc6e384504155e

microsoft.public.dotnet.languages.csharp
microsoft.public.dotnet.languages.vb
"tshad" <ts**********@ftsolutions.comwrote in message
news:uM***************@TK2MSFTNGP06.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?

Thanks,

Tom


Aug 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: mheydman | last post by:
I posted this to the notes page of the COM PHP documentation... I will post an update there if I find a solution here. I have need for a commercial COM/DOTNET class library that requires a...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
12
by: Joel | last post by:
Hi all, Forgive me if I've expressed the subject line ill. What I'm trying to do is to call a c++ function given the following: a. A function name. This would be used to fetch a list of...
10
by: Resant | last post by:
I have a query : Exec 'Select * From Receiving Where Code In (' + @pCode + ')' @pCode will contain more than one string parameter, eg : A1, A2, A3 How can i write that parameters, I try use :...
8
by: Dennis Myrén | last post by:
I have these tiny classes, implementing an interface through which their method Render ( CosWriter writer ) ; is called. Given a specific context, there are potentially a lot of such objects,...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
4
by: MicroMoth | last post by:
Hi, I'm trying to write a update method, in which when the user clicks the update button the update method is passed 10 form fields. Then a update SQL is run to update the database. My question...
4
by: tshad | last post by:
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...
4
by: Deckarep | last post by:
Hello fellow C# programmers, This question is more about general practice and convention so here goes: I got into a discussion with a co-worker who insisted that as a general practice all...
7
by: amygdala | last post by:
Hi all, I'm starting this new project in which I'ld like to implement sort of a design pattern I have seen being used in the CodeIgniter framework. Basically, the site will examine the URI and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.