Home c# How to repeat the timer every hour?

How to repeat the timer every hour?

Author

Date

Category

Good. I have a timer code. I need information how to repetition timer every hour.
It is also necessary to repeat according to the introduced number (there is all the time of operation of the program)

Timer code.`Dispatcher Timer = New Dispatcher ();
Timer.tick + = New EventHandler (Timer_Click);

timer.interval = new timepan (0, 0, 1);
    Timer.Start ();

`

Private Void Timer_Click (Object Sender, Eventargs E)
  {
    DateTime D;
    d = datetime.Now;
    If (D.Hour == Hours & amp; & amp; d.second & lt; 1)
    {
      if (D.Minute == Minutes)

Answer 1, Authority 100%

timer.elapsed + = new elapsedeventhandler (EEVENT);
private static void eevent (object source, ElapsedEventArgs e)
{
  int dateTime = DateTime.Now.Hour;
  if (dateTime & lt; = DateTime.Now.Hour || (dateTime == 23 & amp; & amp; DateTime.Now.Hour == 0))
  {
    dateTime = DateTime.Now.Hour;
  }
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions