예제 #1
0
        private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            var timer = (Timer)sender;

            if (Holiday.TodayIsWorkday)
            {
                System.Threading.Thread.Sleep(randomDelay.Next(30 * 60 * 1000));
                Marcador.MarcarPonto(_login, _senha);
            }

            if (timer.Interval != oneDay)
            {
                timer.Interval = oneDay;
            }
        }
예제 #2
0
        protected void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            var timer = (Timer)sender;

            if (Holiday.TodayIsWorkday)
            {
                System.Threading.Thread.Sleep(randomDelay.Next(30 * 60 * 1000));
                Marcador.MarcarPonto(
                    Properties.Settings.Default.Login,
                    Properties.Settings.Default.Senha);
            }

            if (timer.Interval != oneDay)
            {
                timer.Interval = oneDay;
            }
        }