demon (stand alone executable) question

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi folks,

(note: Newbie post)

I have inherited the code maintenance and development of an existing
internal webservice written in c#. It's a fairly standard client, appserver,
dbserver architecture and essentially determines an employees to do list. I
has been developed in Visual studio, which is new for me as well.

I am required to add the ability for the application to email reminders to
employees if their tasks are overdue.

I can determine the list of user's emails from the database using a
'get_overdue_email' stored procedure.

What I need to write is a executable, that can be run from the commandline
for example: C:>emaildemon \60 which invokes my executable, runs the stored
procedure every 60 minutes, calls the mailer passing the list of users and
appropriate subject etc etc. Note the demon will continue to run every 60
mins, until a C:>emaildemon \stop command is issued so some kind of
'sleep' state needs to be entered.

Can anyone point me in the direction of an example project or code example,
which I can base my app on.

Any tips or suggestions... the functionality is pretty much as described,
the implementation (i.e. command line) is not at all fixed.


Thanks

Tom
 
Tom said:
(note: Newbie post)

I have inherited the code maintenance and development of an existing
internal webservice written in c#. It's a fairly standard client, appserver,
dbserver architecture and essentially determines an employees to do list. I
has been developed in Visual studio, which is new for me as well.

I am required to add the ability for the application to email reminders to
employees if their tasks are overdue.

I can determine the list of user's emails from the database using a
'get_overdue_email' stored procedure.

What I need to write is a executable, that can be run from the commandline
for example: C:>emaildemon \60 which invokes my executable, runs the stored
procedure every 60 minutes, calls the mailer passing the list of users and
appropriate subject etc etc. Note the demon will continue to run every 60
mins, until a C:>emaildemon \stop command is issued so some kind of
'sleep' state needs to be entered.

Can anyone point me in the direction of an example project or code example,
which I can base my app on.

Any tips or suggestions... the functionality is pretty much as described,
the implementation (i.e. command line) is not at all fixed.

It sounds like what you *really* want is a Windows service, which is
pretty easy to write in .NET. You could have a command line app to
start/stop/configure it if absolutely necessary, but you can do pretty
much everything use net start/stop anyway.
 
Jon,

I've done some reading, and this does sound like what I want... One more
question

My web application has a webbased administrative logon, for things like
entering new users into the database . Will it be possible to stop and start
windows services on my app server machine from a client browser?

thanks

Tom
 
Tom said:
I've done some reading, and this does sound like what I want... One more
question

My web application has a webbased administrative logon, for things like
entering new users into the database . Will it be possible to stop and start
windows services on my app server machine from a client browser?

Well, I don't know what programmatic access there is to the windows
services, but you could always run "net stop" or "net start" (with
appropriate parameters) using the Process class.
 
Jon Skeet said:
Well, I don't know what programmatic access there is to the windows
services, but you could always run "net stop" or "net start" (with
appropriate parameters) using the Process class.

The System.ServiceProcess.ServiceController class would be the "programmatic
access" solution. It has methods for starting, stopping, pausing,
continuing, etc, etc... a windows service.

Good luck,
Ryan LaNeve
MCSD.NET
 
Thanks for your help


Ryan LaNeve said:
The System.ServiceProcess.ServiceController class would be the "programmatic
access" solution. It has methods for starting, stopping, pausing,
continuing, etc, etc... a windows service.

Good luck,
Ryan LaNeve
MCSD.NET
 
Back
Top