Función: Iniciar aplicación al arrancar Windows
Función para indicar al registro de windows que inicie nuestra aplicación al arrancar el sistema.
public static void ArrancaConWindows() { string Nombre = System.Reflection.Assembly.GetEntryAssembly().GetName().Name; Microsoft.Win32.RegistryKey rkApp = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (Condicion == true) { rkApp.SetValue(Nombre, System.Reflection.Assembly.GetExecutingAssembly().Location); } else { rkApp.DeleteValue(Nombre, false); } }
