473,408 Members | 1,759 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,408 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?
Aug 9 '06 #1
4 1667

"tshad" <ts**********@ftsolutions.comwrote in message
news:eQ****************@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?
app.config, posssibly with a Windows Application to modify the app.config.

David
Aug 9 '06 #2
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.

--
Rgds,
Anand
VB.NET MVP
http://www.dotnetindia.com
"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?
Aug 10 '06 #3
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.
Then they'll need a program to help them do it.
What is the best practice
- use app.config
Not considered "writeable" in .Net applications (at least as far as
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
table
[Big!] Yes to having an editing application.
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.
Aug 10 '06 #4
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!

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"tshad" <ts**********@ftsolutions.comwrote in message
news:eQ****************@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?
|
|
Aug 12 '06 #5

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,...
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...
3
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.