Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2006

Tip: Looking for answers? Try searching our database.

Periodic housekeeping code strategy?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 05 Sep 2006 03:14 GMT
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
Greg Young - 05 Sep 2006 05:12 GMT
Use a System.Thread.Timer that gets loaded when the app starts ? Personally
due to reasons of the app restarting etc I would make this a seperate
service but this may work for you.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

>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.
[quoted text clipped - 4 lines]
>
> Bill
Bill - 06 Sep 2006 13:20 GMT
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

> Use a System.Thread.Timer that gets loaded when the app starts ?
> Personally due to reasons of the app restarting etc I would make this a
[quoted text clipped - 14 lines]
>>
>> Bill
Carl Daniel [VC++ MVP] - 06 Sep 2006 15:06 GMT
> 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
Ben Voigt - 07 Sep 2006 14:07 GMT
>> I think you are saying that a system.thread.timer will work but you
>> prefer something else.
[quoted text clipped - 10 lines]
> 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?

> -cd
Bill - 09 Sep 2006 02:13 GMT
Ok

thanks

Bill

>>> I think you are saying that a system.thread.timer will work but you
>>> prefer something else.
[quoted text clipped - 17 lines]
>
>> -cd
Bill - 13 Sep 2006 21:38 GMT
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

>> I think you are saying that a system.thread.timer will work but you
>> prefer something else.
[quoted text clipped - 12 lines]
>
> -cd

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.