我要读取电脑里注册表的信息,已知道电脑里装了什么软件,然后将数据导入到SQL数据库里,谁能给我个例子啊?无从下手,都快急死了!
有多少是多少,完成了再加200分!
string ls_RegKeyComName = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName"
string ls_RegKeySoftList = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

解决方案 »

  1.   

    Option Explicit
    Public Const HKEY_CLASSES_ROOT = &H80000000
    Public Const HKEY_CURRENT_USER = &H80000001
    Public Const HKEY_LOCAL_MACHINE = &H80000002
    Public Const HKEY_USERS = &H80000003
    Public Const HKEY_PERFORMANCE_DATA = &H80000004
    Public Const HKEY_CURRENT_CONFIG = &H80000005
    Public Const HKEY_DYN_DATA = &H80000006Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As LongDeclare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As LongSub Main()
        Dim ret As Long, hKey As Long, hKey2 As Long
        ret = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft", hKey)
        If ret = 0 Then
            MsgBox "HKLM\SOFTWARE\Microsoft = " & hKey
        End If    ret = RegOpenKey(hKey, "Windows\CurrentVersion", hKey2)
        If ret = 0 Then
            MsgBox "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion = " & hKey2
        End If    'Use RegCreateKey function to create subkey "HKEY_LOCAL_MACHINE\SOFTWARE\Megasoft"
        ret = RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Megasoft", hKey)
        If Not ret Then
            MsgBox "Create HKEY_LOCAL_MACHINE\SOFTWARE\Megasoft SubKey Success"
        Else
            MsgBox "Create Subkey Operation Fail"
        End If    RegCloseKey hKey
        RegCloseKey hKey2
    End Sub  
      

  2.   

    http://cache.baidu.com/c?word=vb%2C%D7%A2%B2%E1%3B%B1%ED&url=http%3A//www%2Eccw%2Ecom%2Ecn/htm/app/aprog/01%5F11%5F14%5F2%2Easp&p=9a769a44d68403b103bd9b79074fcd&user=baidu仔细看看这个文章把
      你对VB和注册表就明白了