For some reason, on the line where I try to set the value of the key, I get the following error:
Object reference not set to an instance of an object
vb Code:
Private Sub writeToKey(ByVal regValue As String) Dim regkey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion\Windows\Device") regkey.SetValue("Device", regValue, RegistryValueKind.String) 'error occurs here regkey.Close() End Sub
What am I doing wrong?




Reply With Quote