MessageBox.Show ("设置开机自启动,需要修改注册表","提示"); string path =System.Windows.Forms.Application.ExecutablePath; RegistryKey rk = Registry.LocalMachine; RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"); rk2.SetValue("JcShutdown", path); rk2.Close(); rk.Close();
MessageBox.Show ("取消开机自启动,需要修改注册表","提示"); string path = System.Windows.Forms.Application.ExecutablePath; RegistryKey rk = Registry.LocalMachine; RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"); rk2.DeleteValue("JcShutdown", false); rk2.Close(); rk.Close();
转载于:https://www.cnblogs.com/YyuTtian/p/4566231.html
相关资源:将某一个exe设置为开机自动启动程序
转载请注明原文地址: https://win8.8miu.com/read-7833.html