Avatar of 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

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
            regKeyObject.CreateSubKey("DevArea", RegistryKeyPermissionCheck.Default)
        End If
        Return GetSetOtherRegSetting
    End Function
.NET ProgrammingVisual Basic.NETProgramming

Avatar of undefined
Last Comment

8/22/2022 - Mon