private void RegisterInStartup(bool Checked)
{
RegistryKey registryValue= Registry.CurrentUser.OpenSubKey
("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
if (Checked))
{
registryKey.SetValue("startupApplication", Application.ExecutablePath);
}
else
{
registryKey.DeleteValue("startupApplication");
}
}