Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Execute code at exact time

Execute code at exact time

Scheduled Pinned Locked Moved C#
helptutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tcombs07
    wrote on last edited by
    #1

    Hey guys I am hoping someone can help. What I want to do is send an e-mail at 7:00 AM once a day. I know how to send an e-mail, and i thought i could do this using either a timer or a thread. This is also going to be a windows service in case that makes a difference. Thanks, Travis Combs

    G B 2 Replies Last reply
    0
    • T tcombs07

      Hey guys I am hoping someone can help. What I want to do is send an e-mail at 7:00 AM once a day. I know how to send an e-mail, and i thought i could do this using either a timer or a thread. This is also going to be a windows service in case that makes a difference. Thanks, Travis Combs

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Here you are: Scheduling Future Dates [^] A New Task Scheduler Class Library for .NET[^]

      Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

      1 Reply Last reply
      0
      • T tcombs07

        Hey guys I am hoping someone can help. What I want to do is send an e-mail at 7:00 AM once a day. I know how to send an e-mail, and i thought i could do this using either a timer or a thread. This is also going to be a windows service in case that makes a difference. Thanks, Travis Combs

        B Offline
        B Offline
        Blue_Boy
        wrote on last edited by
        #3

        Will Timer1 control be solution for you? If yes then enable Timer1 and check current time if is 7:00 AM and in that case execute code which send email.


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        R 1 Reply Last reply
        0
        • B Blue_Boy

          Will Timer1 control be solution for you? If yes then enable Timer1 and check current time if is 7:00 AM and in that case execute code which send email.


          I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

          R Offline
          R Offline
          realJSOP
          wrote on last edited by
          #4

          I always avoid using timer objects. Timer events are the absolute lowest priority events in Windows, and on a busy system, there's a very real possibility that you could miss one. Always use a threaded scheduling implementation. It's much more reliable and customizable.

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          B 1 Reply Last reply
          0
          • R realJSOP

            I always avoid using timer objects. Timer events are the absolute lowest priority events in Windows, and on a busy system, there's a very real possibility that you could miss one. Always use a threaded scheduling implementation. It's much more reliable and customizable.

            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            B Offline
            B Offline
            Blue_Boy
            wrote on last edited by
            #5

            Thanks for your information,I really appreciate it.


            I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups