コード例 #1
0
        public static bool FirstRunThisDay()
        {
            DateTime lastRun = Convert.ToDateTime(ParentalControlsRegistry.GetRegistryKey().GetValue("LastStart"));
            DateTime now     = DateTime.Now;

            return(lastRun.Month != now.Month || lastRun.Day != now.Day);
        }
コード例 #2
0
 public static decimal RestZeit(Span range, decimal uptime)
 {
     return(Math.Round(
                Convert.ToDecimal(ParentalControlsRegistry.GetValue(range.ToString() + "Quota")) -
                Convert.ToDecimal(ParentalControlsRegistry.GetValue(range.ToString() + "Sum")) - uptime,
                2));
 }
コード例 #3
0
 public static void IncrementKey(string key, Decimal incrementBy = 1)
 {
     ParentalControlsRegistry.GetRegistryKey().SetValue(key, Convert.ToDecimal(ParentalControlsRegistry.GetRegistryKey().GetValue(key)) + incrementBy);
 }