Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2017, 05:00
Avatar de Remy_Lebaut
Remy_Lebaut
 
Fecha de Ingreso: junio-2013
Mensajes: 24
Antigüedad: 10 años, 10 meses
Puntos: 1
Pregunta Porque no puedo leer nada dentro de (HKEY_LOCAL_MACHINE) en registro de windows.

Buen dia, tengo una consulta....

He estado haciendo cosillas en el registro de windows desde hace mucho con un simple código y nunca he tenido problemas, pero hoy deseo tocar la colmena de "HKEY_LOCAL_MACHINE" y no he podido acceder desde mi código, alguien tendrá alguna idea del porque?

Código:
Private Sub PruebaLectura
 
    Dim userRoot As String = "HKEY_LOCAL_MACHINE"
    Dim subkey As String = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
    Dim keyName As String = Convert.ToString(userRoot & Convert.ToString("\")) & subkey
 
    Dim permission As New RegistryPermission(RegistryPermissionAccess.AllAccess, keyName)
    permission.Assert()
 
    ' ///////////////////////////////////////
 
    Dim readValue = My.Computer.Registry.GetValue(keyName, "AutoAdminLogon", Nothing)
 
    If My.Computer.Registry.GetValue(keyName, "AutoAdminLogon", Nothing) Is Nothing Then
        txResult.AppendText(TimeOfDay.TimeOfDay.ToString & " > " & "Value does not exist." & vbCrLf)
    Else
        txResult.AppendText(TimeOfDay.TimeOfDay.ToString & " > " & "Current value is = " & readValue.ToString & vbCrLf)
    End If
 
End Sub
Y olvide mencionar que le di permisos de administrador a mi aplicación y ademas lo ejecuto como administrador.