My code: I got it from http://www.youtube.com/watch?v=iBmQmIwcjpA
I used the exact code as in the video.
I think the error is coming from ![]()
![]()
I used the exact code as in the video.
Code:
Option Explicit On
Imports Microsoft.Win32
Public Class Mainform
Public Sub New()
' This call is required by the designer.
InitializeComponent()
addtostartup()
' Add any initialization after the InitializeComponent() call.
End Sub
Public Shared Sub addtostartup()
Dim regkey As RegistryKey
regkey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run",
regkey.SetValue("ApplicationName", Application.ExecutablePath, RegistryValueKind.String)
regkey.Close()
End Sub
End Class

