Mostrando entradas con la etiqueta CREAR ENTRADA EN EL REGISTRO. Mostrar todas las entradas
Mostrando entradas con la etiqueta CREAR ENTRADA EN EL REGISTRO. Mostrar todas las entradas

CREAR ENTRADA EN EL REGISTRO

'HKEY_LOCAL_MACHINE
Function createRegistryKey_LocalMachine(KeyName As String, valueName As String, value As String) As Boolean

        Try
            Dim ExistKey As String = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\" & KeyName, valueName, "Not Exist")

            If ExistKey = "Not Exist" Then
                Dim key As Microsoft.Win32.RegistryKey
                key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION")
                key.SetValue(valueName, value, Microsoft.Win32.RegistryValueKind.DWord)
                key.Close()

                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            Return False
        End Try


    End Function


createRegistryKey_LocalMachine("Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "miAplicacion.exe", "8888")
createRegistryKey_LocalMachine("SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", "miAplicacion.exe", "8888")