471,350 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Confused with services

Hi all,

I'm am I bit of a newb when it comes to services. I need someone to explain
in English how to go about this with no experience in programming services.
Basically I need to make a simple app which monitors the event log and sends
email. That part is fine.

My problem is, I need this program to run when people are not logged in as
it's going to be on a server. So I guess I need a service correct? Now the
problem I have with that is that I need people to be able to configure it.
So I was thinking of putting it in the system tray, no problem. But
apparently you cannot make a service popup a dialog window correct?

How then can I write a service with dialog boxes to configure settings and
what not? Or is there a better way to approach this problem?

Thanks in advance.

Jun 27 '08 #1
4 1017
Yes, you would want a service.
Generally speaking, configuration values are stored in the app.config xml
file, which gets deposited next to the built
service executable as <yourservicename>.exe.config. The service reads this
file when it starts.
You could either write a second app which would load this file and allow
users to edit it and save it, or you could expose a WCF service host in your
service which would allow remote clients to connect and configure it. In
either case, the service would need to be stopped and restarted to read the
new configuration settings.
Peter
"infused" <in*****@infused.comwrote in message
news:58**********************************@microsof t.com...
Hi all,

I'm am I bit of a newb when it comes to services. I need someone to
explain in English how to go about this with no experience in programming
services. Basically I need to make a simple app which monitors the event
log and sends email. That part is fine.

My problem is, I need this program to run when people are not logged in as
it's going to be on a server. So I guess I need a service correct? Now the
problem I have with that is that I need people to be able to configure it.
So I was thinking of putting it in the system tray, no problem. But
apparently you cannot make a service popup a dialog window correct?

How then can I write a service with dialog boxes to configure settings and
what not? Or is there a better way to approach this problem?

Thanks in advance.
Jun 27 '08 #2
On May 3, 6:39*am, "infused" <infu...@infused.comwrote:
Hi all,

I'm am I bit of a newb when it comes to services. I need someone to explain
in English how to go about this with no experience in programming services..
Basically I need to make a simple app which monitors the event log and sends
email. That part is fine.

My problem is, I need this program to run when people are not logged in as
it's going to be on a server. So I guess I need a service correct? Now the
problem I have with that is that I need people to be able to configure it.
So I was thinking of putting it in the system tray, no problem. But
apparently you cannot make a service popup a dialog window correct?

How then can I write a service with dialog boxes to configure settings and
what not? Or is there a better way to approach this problem?

Thanks in advance.
As per my understanding we can have a windows service running in the
background - for dialog boxes we would have to call APIs from Win32
user32.dll as there is no form elements in windows service(i think
so..please correct me if am wrong on this point). Here's a link which
explains calling user32 MessageBox function.
http://msdn.microsoft.com/en-us/libr...in32error.aspx

To configure a service we need to write a client application - like
SQL Server is a service but we can configure the options using
Management Studio/Enterprise manager.
Jun 27 '08 #3
Thanks for the replies.
"infused" <in*****@infused.comwrote in message
news:58**********************************@microsof t.com...
Hi all,

I'm am I bit of a newb when it comes to services. I need someone to
explain in English how to go about this with no experience in programming
services. Basically I need to make a simple app which monitors the event
log and sends email. That part is fine.

My problem is, I need this program to run when people are not logged in as
it's going to be on a server. So I guess I need a service correct? Now the
problem I have with that is that I need people to be able to configure it.
So I was thinking of putting it in the system tray, no problem. But
apparently you cannot make a service popup a dialog window correct?

How then can I write a service with dialog boxes to configure settings and
what not? Or is there a better way to approach this problem?

Thanks in advance.
Jun 27 '08 #4

"infused" <in*****@infused.comwrote in message
news:97**********************************@microsof t.com...
Thanks for the replies.
"infused" <in*****@infused.comwrote in message
news:58**********************************@microsof t.com...
>Hi all,

I'm am I bit of a newb when it comes to services. I need someone to
explain in English how to go about this with no experience in programming
services. Basically I need to make a simple app which monitors the event
log and sends email. That part is fine.

My problem is, I need this program to run when people are not logged in
as it's going to be on a server. So I guess I need a service correct? Now
the problem I have with that is that I need people to be able to
configure it. So I was thinking of putting it in the system tray, no
problem. But apparently you cannot make a service popup a dialog window
correct?

How then can I write a service with dialog boxes to configure settings
and what not? Or is there a better way to approach this problem?

Thanks in advance.
You can implement file change notification in your service that way you
would not have to re-start your service when the config file changes.
Or if you implement WCF you communicate with the service and have the
service update the config file that way the service would be aware of the
changes and it would not have to be restarted.
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Chris | last post: by
2 posts views Thread by ianLOSEatTHEaltispartnersCAPS.com | last post: by
12 posts views Thread by Blaze | last post: by
4 posts views Thread by Amy Snyder | last post: by
2 posts views Thread by postings | last post: by
reply views Thread by Ross Culver | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.