C#添加开机启动

来源:互联网 发布:mac如何安装迅雷影音 编辑:程序博客网 时间:2024/04/28 11:49
 RegistryKey hklm = Registry.LocalMachine;            RegistryKey run = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);            if (run.GetValue("BaiyangLC") == null)            {                string exeFileName = Application.ExecutablePath;//含可执行文件名                run.SetValue("BaiyangLC", exeFileName);            }            run.Close();            hklm.Close();

原创粉丝点击