Triggering an event in Windows service every 1 hour.

  • Thread starter Thread starter Biranchi Narayan Panda
  • Start date Start date
B

Biranchi Narayan Panda

Hello,

I want to create a windows service that will send a mail to a mailing list
every 1 hour.

How do I program so that the mail event automatically triggers every 1 hour.

(If I use timer and the service starts at odd 12:33, then it will fire event
at 1:33, 2:33... . But, I want it it fires at 12:00, 1:00, 2:00 irrespective
of when it starts.)

How do I do this?
 
hi Biranchi,

I want to create a windows service that will send a mail to a mailing
list every 1 hour.

How do I program so that the mail event automatically triggers every 1
hour.

(If I use timer and the service starts at odd 12:33, then it will fire
event at 1:33, 2:33... . But, I want it it fires at 12:00, 1:00, 2:00
irrespective of when it starts.)

How do I do this?
So what is your concrete problem?

Creating a Windows service?

http://msdn.microsoft.com/en-us/library/d56de412(VS.80).aspx

Waiting x seconds?

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/660a1f75-b287-4565-bfdd-75105e0a5527

Sending e-mail?

http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx


mfG
--> stefan <--
 
I want that the mails should go at whole hours, I.e. at 12:00, 1:00,2:00....
and not like 12:01 , 12:02....
I want the mails to go at starting of hours( x:00)

please help
 
hi Biranchi,

I want that the mails should go at whole hours, I.e. at 12:00,
1:00,2:00....
and not like 12:01 , 12:02....
I want the mails to go at starting of hours( x:00)
The naive approach should be sufficient as it does not consume to much
CPU load:
Wait 60 seconds and test for the full hour.

Otherwise: Calculate the difference to the full hour after every operation.


mfG
--> stefan <--
 
Back
Top