if (checkBox1.Checked)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
key.SetValue(ProgramAdi, "\"" + Application.ExecutablePath + "\"");
//checkBox1'in chechked'ı true ise yani işaretli ise Regedit e açılışta çalıştır olarak ekle.
}
else
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
key.DeleteValue(ProgramAdi);
//checkBox1'in chechked'ı false ise yani işaretli değilse Regeditten açılışta çalıştırılacaklardan kaldır.
}