|
|
|
date: Mon, 27 Jun 2005 13:46:21 +0200,
group: microsoft.public.dotnet.myservices
back
Re: Timer - Once a week
Wesley -
In non-GUI programs (such as console or services) you should be using
the timer in System.Threading, rather than the one in Windows Forms. It
allows you to set it based upon a LONG or also a TIMESPAN. The one in
windows forms uses the message pump for notifications, so not really
"tuned" to non-GUI applications.
One form of "Change" method allows you to specify the time until next
event, and the second parameter is the interval which you want it to
repeat on. A week is: 6,048,000,000 which a LONG can represent.
Wesley wrote:
> Hi Lee, thanks for the reply.
>
> That is exactly what I did. (Console Application and using the Windows
> Scheduler).
>
> I would still like to know how to use the Timer component more efficiantly.
>
> "Lee Gillie" wrote in message
> news:eGwJZ5afFHA.3656@tk2msftngp13.phx.gbl...
>
>>Wesley wrote:
>>
>>>Hi, how would I use the Timer component to run code once a week. (example
>>>Mondays 05:00 AM)
>>>
>>>At the moment I use the Timer interval 10000 (10 sec).
>>>
>>>Thanks.
>>>Wesley
>>
>>Why even write a service? Why not create a simple console application, and
>>submit it to run by the Windows Scheduler once a week?
>
>
>
date: Tue, 05 Jul 2005 10:20:53 -0700
author: Lee Gillie
|
|