Exemplo n.º 1
0
 private static bool DayHasCome()
 {
     using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Quizo\QTTabBar")) {
         if (key != null)
         {
             long ticks = QTUtility2.GetRegistryValueSafe(key, "LastChecked", -1L);
             if ((DateTime.MinValue.Ticks < ticks) && (ticks < DateTime.MaxValue.Ticks))
             {
                 TimeSpan span = (DateTime.Now - new DateTime(ticks));
                 return(span.Days > 5);
             }
         }
     }
     SaveLastCheck();
     return(false);
 }
Exemplo n.º 2
0
        private static bool DayHasCome()
        {
            // determines if INTERVAL_CHECK_DAYs have passed since the last check.
            using (RegistryKey key = Registry.CurrentUser.OpenSubKey(RegConst.Root)) {
                if (key != null)
                {
                    long ticks = QTUtility2.GetRegistryValueSafe(key, "LastChecked", -1L);
                    if (DateTime.MinValue.Ticks < ticks && ticks < DateTime.MaxValue.Ticks)
                    {
                        return((DateTime.Now - new DateTime(ticks)).Days > INTERVAL_CHECK_DAY);
                    }
                }
            }

            // if no reg value
            SaveLastCheck();
            return(false);
        }