473,385 Members | 1,400 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,385 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 2621

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

Don't mulitpost.
Aug 9 '06 #2
Hello tshad,

From you list only 2 different approach available - file or DB. What to use
is up to u and depends on you project

Some explanations
app.config is a native solution for the .net xml world
registry is too specific storage to the local user/machine

tI need to pass a few parameters to my Windows Service program. The
tend user will be changing the parameters and settings should be
tsaved.
t>
tWhat is the best practice
t- use app.config
t- use .ini file
t- use Registry
t- write a Windows Application program and save the settings to
tdatabase
ttable
tshould I trust the end user to modify registry, .config or .ini file?
t>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Aug 9 '06 #3
Hi,
"tshad" <ts**********@ftsolutions.comwrote in message
news:uf****************@TK2MSFTNGP02.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.
A windows service with end user interaction?
What is the best practice
- use app.config
Read only
- use .ini file
Possible, I prefer this option
- use Registry
Possible
- write a Windows Application program and save the settings to database
table
You will have to, a window service has not user interaction. You should
write a win app to allow configuration changes.
If you use a file you could use a FileSystemWatcher to detect changes in the
config file and reload the configurations.

should I trust the end user to modify registry, .config or .ini file?
Never instruct an end user to change the registry !!!
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Aug 9 '06 #4
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.uswrote
in message news:uS***************@TK2MSFTNGP05.phx.gbl...
Hi,
"tshad" <ts**********@ftsolutions.comwrote in message
news:uf****************@TK2MSFTNGP02.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.

A windows service with end user interaction?
Actually, this was also for non-service non-web applications. But I want to
be able to allow my boss to make changes to the fields - such as email
addresses or Web sites to monitor. Then when he restarts the Windows
service, it would pick up the changes. I don't want him to have to go to
the file on the server to make the changes.
>
>What is the best practice
- use app.config
Read only
>- use .ini file
Possible, I prefer this option
I liked this one also. Easy to modify.
>
>- use Registry
Possible
>- write a Windows Application program and save the settings to database
table

You will have to, a window service has not user interaction. You should
write a win app to allow configuration changes.
If you use a file you could use a FileSystemWatcher to detect changes in
the config file and reload the configurations.

>should I trust the end user to modify registry, .config or .ini file?

Never instruct an end user to change the registry !!!
You're right, of course.

Thanks,

Tom
>
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Aug 9 '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,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.