VB.Net实现开机启动程序

来源:互联网 发布:手机smali转换java 编辑:程序博客网 时间:2024/05/16 19:00
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Reg As Microsoft.Win32.RegistryKeyReg = Microsoft.Win32.Registry.CurrentUserReg.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)Reg.SetValue("MB", Application.ExecutablePath)'写入注册表Reg.Close()End SubPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickDim Reg As Microsoft.Win32.RegistryKeyReg = Microsoft.Win32.Registry.CurrentUserReg.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)Reg.Deletue("MB")'删除注册表键Reg.Close()End Sub

原创粉丝点击