1、把你的程序,放在【自启动】文件夹里面,即可。
2、也可以用代码设置,设置或取消自启动
Dim starupPath = ProjectPath & "xxx.exe"
Dim loca = Microsoft.Win32.Registry.LocalMachineDim run = loca.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
'run.SetValue("我的项目", False) '取消开机运行run.SetValue("我的项目", starupPath) '设置开机运行loca.Close()
3、弄成服务,参考
https://jingyan.baidu.com/article/59703552fee38f8fc107405c.html