示例#1
0
        //监听时间
        public void WatchTime()
        {
            TimeOfNow time   = new TimeOfNow();
            int       Hour   = time.Today.Hour;
            int       Minute = time.Today.Minute;

            if (Hour == AlarmHour && Minute == AlarmMinute)
            {
                time.Today = DateTime.Now;
                alarm(this, time);
            }
            else
            {
                System.Threading.Thread.Sleep(10000);
                WatchTime();
            }
        }
示例#2
0
 static void myAlarm(object sender, TimeOfNow t)
 {
     Console.WriteLine(t.Today.Hour + ":" + t.Today.Minute + " 到了!!");
 }