hab Problem mit folgendem Code:
Es glabt leider nicht und er spuckt mir auch keine Fehler aus kann mir da evtl jemand Helfen bitte?
VB.NET-Quellcode
- Try
- If WindowsStart.Checked = True Then
- Dim regKey As RegistryKey
- regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
- Dim myPath As String = Application.StartupPath & "\" & "Win.exe"
- regKey.SetValue("myProject", myPath)
- regKey.Close()
- Else
- Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
- key.DeleteValue("myProject")
- End If
- Catch ex As Exception
- MsgBox(ex.Message, MsgBoxStyle.Critical)
- End Try
Es glabt leider nicht und er spuckt mir auch keine Fehler aus kann mir da evtl jemand Helfen bitte?