Every registry startup code i find doesn't work.
ex:
Givees me this error when i run:
![]()
I need a working registry startup code please!
ex:
Code:
Imports Microsoft.Win32
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim regStartUp As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
Dim value As String
value = regStartUp.GetValue("Myapp")
If value <> Application.ExecutablePath.ToString() Then
regStartUp.CreateSubKey("Myapp")
regStartUp.SetValue("Myapp", Application.ExecutablePath.ToString())
End If
End Sub
End Class

I need a working registry startup code please!