예제 #1
0
 public static void RegelmaessigMelden()
 {
     if ((DateTime.UtcNow - RebootRegistry._letzteStarterMeldung).TotalSeconds > 20.0)
     {
         RebootRegistry._letzteStarterMeldung = DateTime.UtcNow;
         RebootRegistry.SetzeRegKey("Lebenszeichen", DateTime.UtcNow.ToBinary().ToString());
     }
 }
예제 #2
0
        public static void SetzeRegKey(string keyname, string inhalt)
        {
            RegistryKey registryKey = RebootRegistry.ConfigRegistryKey();

            try
            {
                registryKey.SetValue(keyname, (object)inhalt);
            }
            finally
            {
                if (registryKey != null)
                {
                    registryKey.Close();
                }
            }
        }
예제 #3
0
        public static string ErmittleRegKey(string keyname, string vorgabeWennLeer)
        {
            RegistryKey registryKey = RebootRegistry.ConfigRegistryKey();
            string      str         = (string)null;

            try
            {
                str = (string)registryKey.GetValue(keyname, (object)vorgabeWennLeer);
            }
            finally
            {
                if (registryKey != null)
                {
                    registryKey.Close();
                }
            }
            return(str);
        }