C#程序自启动

 

 在窗体加载事件里面加入下述代码:

 //设置开机自启动
            RegistryKey registryKey = Registry.CurrentUser.OpenSubKey
         ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
     registryKey.SetValue("CameraVision",Application.ExecutablePath);

 

posted @ 2021-12-08 08:23  WellMandala  阅读(126)  评论(0编辑  收藏  举报