Porque no puedo leer nada dentro de (HKEY_LOCAL_MACHINE) en registro de windows.
Publicado por Evan Hailey (51 intervenciones) el 14/11/2017 18:49:18
Buenas tardes, 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?
Mi código!
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?
Mi código!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
Valora esta pregunta


0