【问题标题】:append a DWORDs Decimal value apposed to Hexadecimal附加一个与十六进制相反的 DWORD 十进制值
【发布时间】:2011-09-12 06:59:24
【问题描述】:
我需要向注册表写入一个新值。我卡在下面的代码上,因为我可以添加一个标准键,我需要将一个新的十进制值放置到一个 DWORD 键(与十六进制值对应)
{暗淡 wsh
wsh = CreateObject("WScript.shell")
wsh.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\NoDrives\dword", "789")}
【问题讨论】:
标签:
vb.net
registry
append
dword
【解决方案1】:
我会使用类似的东西:
Imports Microsoft.Win32
Sub SetNoDrives(value As Integer)
Dim RegPath As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer"
Using Key As RegistryKey = Registry.LocalMachine.OpenSubKey(RegPath)
Key.SetValue("NoDrives", value, RegistryValueKind.DWord)
End Using
End Sub