Vb6 为3个注册表位置添加值

Vb6 为3个注册表位置添加值,vb6,Vb6,我正在尝试向注册表中的3个位置添加值: HKEY_CURRENT_USER\Software\Intel\Indeo HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Indeo HKEY_USERS\S-1-5-21-669792009-2657969199-152103076-1000\Software\Intel\Indeo 这是我需要添加到每个注册表路径的字符串: “选项”=“36061132911” 出于某种原因,我无法测试此代码,只是为了查看它是否添加了值: Cr

我正在尝试向注册表中的3个位置添加值:

HKEY_CURRENT_USER\Software\Intel\Indeo
HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Indeo
HKEY_USERS\S-1-5-21-669792009-2657969199-152103076-1000\Software\Intel\Indeo
这是我需要添加到每个注册表路径的字符串:

“选项”=“36061132911”

出于某种原因,我无法测试此代码,只是为了查看它是否添加了值:

CreateObject("WScript.Shell").RegWrite "HKEY_USERS\S-1-5-21-669792009-2657969199-152103076-1000\Software\Intel\Indeo", "C:\Program Files\FastTuner\Clean.exe"

您可以将这两个函数添加到项目中,以处理注册表中的值:

' Write Reg:
'       Write to the Windows Registry
'       RegType should be 'REG_SZ' for string, 'REG_DWORD' for an integer,
'       'REG_BINARY' for a binary or boolean, and 'REG_EXPAND_SZ' for an expandable string
Function WriteReg(RegPath, Value, RegType)
    Dim Key
    Dim objRegistry
    Set objRegistry = CreateObject("Wscript.shell")
    Key = objRegistry.RegWrite(RegPath, Value, RegType)
    WriteReg = Key
End Function

' Read Reg:
'       Read from the Windows Registry
Function ReadReg(RegPath)
    Dim Key
    Dim objRegistry
    Set objRegistry = CreateObject("Wscript.shell")
    Key = objRegistry.RegRead(RegPath)
    ReadReg = Key
End Function

您可以将这两个函数添加到项目中,以处理注册表中的值:

' Write Reg:
'       Write to the Windows Registry
'       RegType should be 'REG_SZ' for string, 'REG_DWORD' for an integer,
'       'REG_BINARY' for a binary or boolean, and 'REG_EXPAND_SZ' for an expandable string
Function WriteReg(RegPath, Value, RegType)
    Dim Key
    Dim objRegistry
    Set objRegistry = CreateObject("Wscript.shell")
    Key = objRegistry.RegWrite(RegPath, Value, RegType)
    WriteReg = Key
End Function

' Read Reg:
'       Read from the Windows Registry
Function ReadReg(RegPath)
    Dim Key
    Dim objRegistry
    Set objRegistry = CreateObject("Wscript.shell")
    Key = objRegistry.RegRead(RegPath)
    ReadReg = Key
End Function

我不明白,你为什么不能测试它?我不明白,你为什么不能测试它?