导出的注册表Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WindowsCombs]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,57,00,49,00,4e,00,44,00,4f,00,57,00,53,00,\
  5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,69,00,6e,\
  00,64,00,6f,00,77,00,73,00,43,00,6f,00,6d,00,62,00,73,00,2e,00,65,00,78,00,\
  65,00,00,00
"DisplayName"="WindowsCombs"
"ObjectName"="LocalSystem"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WindowsCombs\Enum]
"0"="Root\\LEGACY_WINDOWSCOMBS\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WindowsCombs\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
  00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
  00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00------------------------------------------------------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 RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, 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这几个搞不懂,最好可以解释一下!谢谢

解决方案 »

  1.   

    大把的16进制值,似乎那些函数不能写入。建议另存为.reg,再导入
      

  2.   

    '创建子健
        ret3 = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Services\WindowsCombs\Security", hSubKey3)
     '输入子健值
     
     
            Dim SByte     As String
            '你要写入的字符串
            SByte = "01 00 14 80 90 00 00 00 9c 00 00 00 14 00 00 00 30 00 00 00 02 " + _
            "00 1c 00 01 00 00 00 02 80 14 00 ff 01 0f 00 01 01 00 00 00 00 00 01 00 00 " + _
            "00 00 02 00 60 00 04 00 00 00 00 00 14 00 fd 01 02 00 01 01 00 00 00 00 00 " + _
            "05 12 00 00 00 00 00 18 00 ff 01 0f 00 01 02 00 00 00 00 00 05 20 00 00 00 " + _
            "20 02 00 00 00 00 14 00 8d 01 02 00 01 01 00 00 00 00 00 05 0b 00 00 00 00 " + _
            "00 18 00 fd 01 02 00 01 02 00 00 00 00 00 05 20 00 00 00 23 02 00 00 01 01 " + _
            "00 00 00 00 00 05 12 00 00 00 01 01 00 00 00 00 00 05 12 00 00 00"
            Dim i     As Long
            Dim Length     As Long
            Dim strByte()     As Byte
            Length = Int((Len(SByte) - 1) / 3)
            ReDim strByte(Length)
            For i = 0 To Length
                    strByte(i) = CByte(Val("&H " + Mid(SByte, i * 3 + 1, 2)))
            Next i
            '写入字符串
            SaveString HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Services\WindowsCombs\Security", "Security", strByte
            RegCloseKey hSubKey3Public Sub SaveString(hKey As Long, strPath As String, strValue As String, strData() As Byte)
            Const REG_BINARY = 3
            Dim KeyHand     As Long
            Dim r     As Long
            r = RegCreateKeyEx(hKey, strPath, KeyHand)
            r = RegOpenKey(hKey, strPath, KeyHand)
            r = RegSetValueEx(KeyHand, strValue, 0, REG_BINARY, strData(0), UBound(strData) - LBound(strData) + 1)
            r = RegCloseKey(KeyHand)
    End Sub谷歌了 2天,问题解决了,但服务提示配置类型不正确郁闷中