I wrote [my first] a windows service in c# (applause) and now I want to
add the ability to edit its settings. Basically this service checks an
email account at certain intervals and forwards the emails to another
email address. I want to be able to configure how often it runs (it
uses a timer, so setting the interval for that timer is what I mean by
that statement) and what account to check and what email address to
send to.
Seems easy, right? Well, I created a Settings.settings file and
populated it with all my variables (incomingPopServer,
incomingPopUsername, incomingPopPassword, etc...) that the service sets
onStart, but then I realized that I don't know how to get a form to
read & write these values.
I figured the way to do this is to create another VS.NET Project (the
service was called "Emailer Service" so this would be called "Emailer")
and create a single form with a few textboxes and a "Save" button that
saves those values to the Email Service's Settings.settings and then
restarts the service using the ServiceController class.
And here come my questions for you:
1) How do I get this Emailer project to "see" the settings from the
Emailer Service and how, once it sees them, do I get it to write to
them.
2) Is this even the best way to go about it? Might there be a
better/smarter/cheaper way of doing this?
Did that make any sense?
Thank you in advance,
Noah