Triggering an event in Windows service every 1 hour.

  • Thread starter Biranchi Narayan Panda
  • 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?
 
S

Stefan Hoffmann

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 <--
 
B

Biranchi Narayan Panda

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
 
S

Stefan Hoffmann

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 <--
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top