Пример #1
0
        public void LookTime()
        {
            PresentTime time    = new PresentTime();
            int         bHour   = time.Now.Hour;
            int         bMinute = time.Now.Minute;

            if (bHour == anHour && bMinute == aMinute)
            {
                time.Now = DateTime.Now;
                AlarmEvent(this, time);
            }
            else
            {
                System.Threading.Thread.Sleep(1000);
                LookTime();
            }
        }
Пример #2
0
 static void myAlarmEvent(object sender, PresentTime a)
 {
     Console.WriteLine("时间到啦");
 }