Writing key to registry - .NET throws a fit!

CryoEnix

Well-known member
Joined
Jan 11, 2003
Messages
93
Location
Wrexham, Wales
Okay, Ive got this code:


Code:
        Dim myKey As Microsoft.Win32.RegistryKey
        Dim strLocation As String
        Dim strKey As String


        strLocation = "SOFTWARE\CryoBeeF\Wine Totals"
        strKey = "Path"

        myKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(strLocation)
        myKey.SetValue(strKey, Application.StartupPath)error on this line
        myKey.Close()

Now, the "Path" Part already exists in the registry, but its value is blank until this code fills it is - however, I get this error message when I try to run it:

"Additional Information: Cannot write to the registry key"

What does this mean, and how can I bypass it/fix my code?
 
Lol! All this time Ive been pulling my hair out, and it turns out to be a missing parameter, doh! Thanks jdemackio, youre a saviour.
 
Back
Top