troubleshooting Question

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

Avatar of RIAS
RIASFlag for United Kingdom of Great Britain and Northern Ireland asked on
Programming.NET ProgrammingVisual Basic.NET
5 Comments2 Solutions340 ViewsLast Modified:
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros