//本地推送 public static void NotificationMessage(string news, int date, int RepeatType) { int year = System.DateTime.Now.Year; int month = System.DateTime.Now.Month; int day = System.DateTime.Now.Day; int hour = date / 100 % 100; int minute = date % 100; if (RepeatType == 0) { month = date / 1000000; day = date / 10000 % 100; System.DateTime newDate = new System.DateTime(year, month, day, hour, minute, 0); if (newDate > System.DateTime.Now) { PushNotification.NotificationMessage(news, newDate, 0); } } else if (RepeatType == 1) { System.DateTime newDate = new System.DateTime(year, month, day, hour, minute, 0); if (newDate > System.DateTime.Now) { PushNotification.NotificationMessage(news, newDate, 1); } else { PushNotification.NotificationMessage(news, newDate.AddDays(1), 1); } } else if (RepeatType == 2) { System.DateTime newDate = new System.DateTime(year, month, day, hour, minute, 0); int nNewWeek = date / 10000 % 100; int nWeek = System.Convert.ToInt16(System.DateTime.Now.DayOfWeek); int num = Math.Abs(nNewWeek - nWeek); if (newDate > System.DateTime.Now) { PushNotification.NotificationMessage(news, newDate.AddDays(num), 2); } else { PushNotification.NotificationMessage(news, newDate.AddDays(num + 7), 2); } } }