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. Web Development
  3. ASP.NET
  4. set timer interval by day,month

set timer interval by day,month

Scheduled Pinned Locked Moved ASP.NET
tutorial
4 Posts 2 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.
  • M Offline
    M Offline
    mbbisht
    wrote on last edited by
    #1

    i have used following code to set timer interval timer = new Timer(); timer.AutoReset = true; timer.Interval = 60000 * Convert.ToDouble(ConfigurationSettings.AppSettings"IntervalMinutes"]); timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); but i want to change timer interval per day , per month how to do it please suggest awaiting for answer Mahendra

    I 3 Replies Last reply
    0
    • M mbbisht

      i have used following code to set timer interval timer = new Timer(); timer.AutoReset = true; timer.Interval = 60000 * Convert.ToDouble(ConfigurationSettings.AppSettings"IntervalMinutes"]); timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); but i want to change timer interval per day , per month how to do it please suggest awaiting for answer Mahendra

      I Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      well first of all a timer can only be as big as an intmillioseconds So have it set to 30000 or 60000 which is 30 secnds or 60 seconds respectively and then check your days Nick

      -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

      1 Reply Last reply
      0
      • M mbbisht

        i have used following code to set timer interval timer = new Timer(); timer.AutoReset = true; timer.Interval = 60000 * Convert.ToDouble(ConfigurationSettings.AppSettings"IntervalMinutes"]); timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); but i want to change timer interval per day , per month how to do it please suggest awaiting for answer Mahendra

        I Offline
        I Offline
        Ista
        wrote on last edited by
        #3

        like I said have a short interval then test the current time by that. If its 15 days then record the date somewhere then do a compare at each short interval

        -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

        1 Reply Last reply
        0
        • M mbbisht

          i have used following code to set timer interval timer = new Timer(); timer.AutoReset = true; timer.Interval = 60000 * Convert.ToDouble(ConfigurationSettings.AppSettings"IntervalMinutes"]); timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); but i want to change timer interval per day , per month how to do it please suggest awaiting for answer Mahendra

          I Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          an int cannot go that high. you must set it to one minute and then do a date compare. Theres no way around it

          -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

          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