Triggering an event in Windows service every 1 hour.

Discussion in 'ASP .Net' started by Biranchi Narayan Panda, Feb 21, 2010.

  1. 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?
     
    Biranchi Narayan Panda, Feb 21, 2010
    #1
    1. Advertising

  2. hi Biranchi,

    On 21.02.2010 16:43, Biranchi Narayan Panda wrote:
    > 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 <--
     
    Stefan Hoffmann, Feb 21, 2010
    #2
    1. Advertising

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



    "Stefan Hoffmann" <> wrote in message
    news:...
    > hi Biranchi,
    >
    > On 21.02.2010 16:43, Biranchi Narayan Panda wrote:
    >> 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 <--
     
    Biranchi Narayan Panda, Feb 21, 2010
    #3
  4. hi Biranchi,

    On 21.02.2010 17:34, Biranchi Narayan Panda wrote:
    > 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 <--
     
    Stefan Hoffmann, Feb 21, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tom

    Page Load every 1 hour

    tom, Aug 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    375
    Mark Fitzpatrick
    Aug 18, 2003
  2. Replies:
    2
    Views:
    911
    Hal Rosser
    Jun 1, 2007
  3. ssylee
    Replies:
    4
    Views:
    539
    Thad Smith
    Jan 1, 2008
  4. Monica

    fire a method or event every hour automatically?

    Monica, Jun 27, 2008, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    198
    Tanzim Saqib
    Jul 1, 2008
  5. Chris Gunnels
    Replies:
    4
    Views:
    187
    Robert Klemme
    Sep 16, 2010
Loading...

Share This Page