Timer in the web application on servre site.

V

Vasil Buraliev

Would you tell me please is it posible to make some code somewhere in web
application where this code will be called or started after some time?
For example.
I wanna my web applicaiton to check let's say every12 hours which day it is
on the web server than let's say if it's monday... to do somehing.

Is it possible with some technologi or somehow somewhere insite web
application?

best regards.
Vasil
 
C

-=Chris=-

I've seen situations where it's beneficial to do what Vasil wants to do.
For example, if you pay for a web host, and you only have access to run web
pages, but not local programs and services, then you can't go the service
route. Rather than look at it as a timer related programming challenge,
perhaps it would be better to simply flag which dates the required action
has been performed on, and simply check the status each time the page is
loaded.

I was minding my own business when Steve C. Orr [MVP, MCSD] blurted out:
 
J

Jj

You can do this by starting a new Thread in a static block in a class.

Here is how you do it.
1. create a static constructor in a "Manager" class (or add it in any class
you prefer) -- this guarentees that the following thread only get created
once (when you first reference this class.)
2. In that static constructor create a new thread and let it do whatever you
want every 12 hours (using a loop and sleep method)
3. In your web application, refer to this class (by either instantiate the
Manager class or just reference it)


Jianjun
 
V

Vasil Buraliev

This sounds very interesting. I will try this. Thanks for your idea Jianjun,
and thank you all you guys for your reply.

regards.
Vasil
 

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

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top