Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Reg As Microsoft.Win32.RegistryKey
Reg = Microsoft.Win32.Registry.CurrentUser
Reg.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
Reg.SetValue("MB", Application.ExecutablePath)'写入注册表
Reg.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Reg As Microsoft.Win32.RegistryKey
Reg = Microsoft.Win32.Registry.CurrentUser
Reg.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
Reg.Deletue("MB")'删除注册表键
Reg.Close()
End Sub
VB.Net实现开机启动程序
最新推荐文章于 2023-01-14 19:34:17 发布