.net 修改程序在注册表中的键值
开机自启动
RegistryKey R_local = Registry.LocalMachine;//RegistryKey R_local = Registry.CurrentUser; RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"); R_run.SetValue("清大东方定时扫描任务", Application.ExecutablePath); R_run.Close(); R_local.Close();
关闭自启动
RegistryKey R_local = Registry.LocalMachine;//RegistryKey R_local = Registry.CurrentUser; RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"); R_run.DeleteValue("清大东方定时扫描任务", false); R_run.Close(); R_local.Close();

浙公网安备 33010602011771号