public static void RegelmaessigMelden() { if ((DateTime.UtcNow - RebootRegistry._letzteStarterMeldung).TotalSeconds > 20.0) { RebootRegistry._letzteStarterMeldung = DateTime.UtcNow; RebootRegistry.SetzeRegKey("Lebenszeichen", DateTime.UtcNow.ToBinary().ToString()); } }
public static void SetzeRegKey(string keyname, string inhalt) { RegistryKey registryKey = RebootRegistry.ConfigRegistryKey(); try { registryKey.SetValue(keyname, (object)inhalt); } finally { if (registryKey != null) { registryKey.Close(); } } }
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); }