Posts Tagged ‘Modify Registry Key value’

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

, , ,

No Comments



SetPageWidth