Cannot write to the registry key in .Net

Public Function SetValue(ByVal Value As String, ByVal k As String) As String
Dim mReg As RegistryKey = Registry.LocalMachine.OpenSubKey(“Software”, RegistryKeyPermissionCheck.ReadWriteSubTree, Security.AccessControl.RegistryRights.FullControl)
Try

mReg.OpenSubKey(My.Application.Info.CompanyName & “\” & My.Application.Info.Description, True).SetValue(k, Value)

Return True
Catch ex As Exception
Throw ex
End Try

End Function

, , ,

  1. No comments yet.
(will not be published)
Submit Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Subscribe to comments feed
  1. No trackbacks yet.

SetPageWidth