自启动注册
public void RunWhenStart(bool Started, string name, string path) { RegistryKey HKLM = Registry.LocalMachine; RegistryKey Run = HKLM.CreateSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\"); if (Started == true) { try { Run.SetValue(name, path); HKLM.Close(); } catch (Exception) { MessageBox.Show("注册表修改错误(开机自启未实现)"); } } else { try { if (Run.GetValue(name) != null) { Run.DeleteValue(name); HKLM.Close(); } else return; } catch (Exception e) { MessageBox.Show(e.Message); // } }