Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Mon, 27 Jun 2005 13:46:21 +0200,    group: microsoft.public.dotnet.myservices        back       


Timer - Once a week   
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
date: Mon, 27 Jun 2005 13:46:21 +0200   author:   Wesley

Re: Timer - Once a week   
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: Thu, 30 Jun 2005 13:00:18 -0700   author:   Lee Gillie

Re: Timer - Once a week   
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: Fri, 1 Jul 2005 08:42:23 +0200   author:   Wesley

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us