elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  Agregar un Archivo .Reg al Registro de Windows, Como hago???
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: Agregar un Archivo .Reg al Registro de Windows, Como hago???  (Leído 9,730 veces)
Pitoniso

Desconectado Desconectado

Mensajes: 118


Ver Perfil
Re: Agregar un Archivo .Reg al Registro de Windows, Como hago???
« Respuesta #10 en: 19 Noviembre 2006, 23:11 pm »

Bueno el problema es k me he partido la cabeza y todavia no lo logroo.. mas especifico...plss

tambien miren este codigo...

Private Const REG_DWORD = 4

Private Const ERROR_SUCCESS = 0&
Private Const HKEY_CURRENT_USER = &H80000001
Private Const STANDARD_RIGHTS_ALL = &H1F0000
Private Const SYNCHRONIZE = &H100000

Private Const KEY_QUERY_VALUE = &H1
Private Const KEY_SET_VALUE = &H2
Private Const KEY_CREATE_LINK = &H20
Private Const KEY_ENUMERATE_SUB_KEYS = &H8
Private Const KEY_CREATE_SUB_KEY = &H4
Private Const KEY_NOTIFY = &H10

Private Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))

Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegLoadKey Lib "advapi32.dll" Alias "RegLoadKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal lpFile As String) As Long


Dim resultado As Long
Dim hKey As Long

Private Sub Command1_Click()
        resultado = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\SimonTatham\PuTTY\Sessions\Default%20Settings", 0, KEY_ALL_ACCESS, hKey)
   
    If resultado = ERROR_SUCCESS Then
        RegSetValueEx hKey, "ProxyPort", 0, REG_DWORD, 3128, 4
    End If
End Sub

Esto me agrega el Puerto 3128 en el Registro, ahora trate de hacer que en vez de agregarlo por codigo hacerlo por mediacion de un TextBox, o sea que el user lo introduzca...

Guarde el Valor en una Variable y la puse en donde va el 3128 de este caso y me agrega una burrada que para que, se que algo no estoy haciendo pero que....

necesito agregar ese Reg para que entonces mi soft pueda modificar este dato y otros mas...

grx


En línea

Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Como agregar un arreglo de tipo persona en un Archivo en java.
Java
rub'n 7 7,872 Último mensaje 30 Marzo 2011, 17:10 pm
por rub'n
guardar registro como un archivo
Programación General
ton_ 3 3,717 Último mensaje 1 Julio 2011, 08:52 am
por d(-_-)b
Agregar columnas a archivo CVS
Scripting
abnervg413eh 1 3,669 Último mensaje 9 Diciembre 2011, 23:01 pm
por abnervg413eh
como agregar una funcion a un archivo dll? « 1 2 »
Ingeniería Inversa
palomito 13 7,842 Último mensaje 28 Mayo 2012, 21:34 pm
por The Swash
Ayuda! ¿Como le hago para agregar datos a un archivo de acceso aleatorio?
Java
Isatol 0 1,728 Último mensaje 21 Abril 2013, 02:42 am
por Isatol
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines