Avatar of RIAS
RIAS
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

How to enter a field and its value in registry key+vb.net

Hi,
How to enter a field and its value in registry key I am using vb.net windows.
Already have this function
 Public Function SetOtherRegSetting(ByVal Section As String, ByVal RegKeyName As String, ByVal Field As String, ByVal value As String) As String
        Dim RegSection As String
        Dim regKeyObject As RegistryKey
        Dim TempObj As Object = ""
        Dim GetSetOtherRegSetting As String = String.Empty
        GetSetOtherRegSetting = ""
        RegSection = Section & "\" & RegKeyName & "\"
        regKeyObject = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(RegSection)
        If Not regKeyObject Is Nothing Then
            TempObj = regKeyObject.GetValue(Field)
            If Not TempObj Is Nothing Then
                GetSetOtherRegSetting = TempObj.ToString()
                TempObj = Nothing
            End If
        Else
            regKeyObject.CreateSubKey("DevArea", RegistryKeyPermissionCheck.Default)
        End If
        regKeyObject.Close()
        Return GetSetOtherRegSetting
    End Function
RegistrySettings.docx
.NET ProgrammingVisual Basic.NETProgramming

Avatar of undefined
Last Comment
RIAS

8/22/2022 - Mon