Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Timer in the web application on servre site.

Reply
Thread Tools

Timer in the web application on servre site.

 
 
Vasil Buraliev
Guest
Posts: n/a
 
      11-08-2003
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


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      11-09-2003
ASP.NET pages aren't designed to be used this way.
Instead I'd suggest creating a Windows Service.
Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com



"Vasil Buraliev" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
-=Chris=-
Guest
Posts: n/a
 
      11-09-2003
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:

> ASP.NET pages aren't designed to be used this way.
> Instead I'd suggest creating a Windows Service.
> Here's more information on Windows Services:
>

http://msdn.microsoft.com/library/de...owsService.asp
>
>
> "Vasil Buraliev" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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


--
Insert corny line here


 
Reply With Quote
 
Jj
Guest
Posts: n/a
 
      11-09-2003
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

"Vasil Buraliev" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Vasil Buraliev
Guest
Posts: n/a
 
      11-09-2003
This sounds very interesting. I will try this. Thanks for your idea Jianjun,
and thank you all you guys for your reply.

regards.
Vasil

"Jj" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> "Vasil Buraliev" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I know about the shutdown timer, is there a "switch on" timer... Mal Carter Computer Support 3 01-12-2008 01:58 AM
Retrieving client side control value using servre VB.NET Kevin Humphreys ASP .Net 2 11-29-2006 01:52 PM
page timer, or redirect timer Simon ASP .Net 1 11-04-2005 07:14 PM
System.Timers.Timer/System.Threading.Timer Not Firing At All on Dev Server james.e.coleman@gmail.com ASP .Net 1 02-22-2005 09:41 PM
System.Timers.Timer vs. System.Threading.Timer Kelsang Wangchuk ASP .Net 0 07-31-2003 04:28 PM



Advertisments