Creating a system to control settings of the service?

Administrator

VB.NET Forum Admin
Joined
Jun 3, 2004
Messages
1,461
Programming Experience
10+
I'm building a windows service that will download items daily and store in a database. I'd like to provide the user a way to control frequency of downloads, options, e-mail notifications, i.e. SMTP config, addresses, etc.

What's the best way to associate a UI with a running windows service? I guess a common data store would be an option, but curious how you make your windows services configurable for users to control options, etc.
 

ceegh

New member
Joined
Aug 6, 2004
Messages
2
Programming Experience
10+
You have probably moved forward on this issue already (looking at the original post date), but I thought I might put in a suggestion.

A common database table is probably the best move with your situation if you are using a shared DB anyway. I've used a SQL Server table for queuing commands issued from client apps (just an XML statement) that are then parsed by the service and used to issue commands. This helps avoid that nasty "no desktop interaction" rule that Windows services are supposed to follow while making it easy to create client interaction with your service.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
I believe the way this is usually done is to have a seperate executable responsible for setting the configuration settings. For instance, you could create a Winform app that displays and allows the user to modify the configuration settings. That app would save these settings to a dataStore (text file, XML file, dataBase, ...), then your service would read that config file. If changes to important settings are made, the Winform app could restart the service.
 
Top Bottom