Periodic housekeeping code strategy?

B

Bill

I have a need to run a function on my dot net 2.0 web server every xx
minutes forever - whether or not a client is logged on.

Anyone have suggestions or examples of good ways to do this?


Thanks

Bill
 
B

Bill

I think you are saying that a system.thread.timer will work but you prefer
something else.

Can you expand on this a little - I'm not sure what you are recommending

Thanks

Bill
 
C

Carl Daniel [VC++ MVP]

Bill said:
I think you are saying that a system.thread.timer will work but you
prefer something else.

Can you expand on this a little - I'm not sure what you are
recommending

Make and install a Windows Service that does your periodic housekeeping
(perhaps by simply invoking one of your web services, or perhaps by working
"behind the scenes", depending on exactly what that housekeeping is.

See the System.ServiceProcess.ServiceBase class in the .NET framekwork SDK
documentation for information on building a windows service in .NET. It's
quite easy.

-cd
 
B

Ben Voigt

Carl Daniel said:
Make and install a Windows Service that does your periodic housekeeping
(perhaps by simply invoking one of your web services, or perhaps by
working "behind the scenes", depending on exactly what that housekeeping
is.

See the System.ServiceProcess.ServiceBase class in the .NET framekwork SDK
documentation for information on building a windows service in .NET. It's
quite easy.

Why is everyone recommending re-inventing this wheel, when the cron
daemon -- oops I mean Scheduler service -- is perfectly suited for the task?
Are there major security problems with the scheduler service so that no one
will use it?
 
B

Bill

Ok

thanks

Bill

Ben Voigt said:
Why is everyone recommending re-inventing this wheel, when the cron
daemon -- oops I mean Scheduler service -- is perfectly suited for the
task? Are there major security problems with the scheduler service so that
no one will use it?
 
B

Bill

I have been reading up on Windows Services and this looks like the way to go
but I am not how I can hook to my Web server code - if at all

I need to run MyFunction() and although it would be easy for me to clone it
in the Windows Service I would prefer to call the original if possible so I
don't have another thing to compile each time I change the server code

Is my .net web server code always accessible - is any of it always running
or is it essentially dead untill activated by a web client?


Thanks

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top