本文介绍了附加一个 DWORDs 十进制值附加到十六进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要向注册表写入一个新值.我被下面的代码困住了,因为我可以添加一个标准键,我需要将一个新的十进制值放置到一个 DWORD 键(转换为一个十六进制值)
I need to write a new value to the registry. I have come stuck at the following code because what i can add is a standard key and i need to place a new decimal value to a DWORD key (aposed to a hexadecimal value)
{昏暗的 wshwsh = CreateObject("WScript.shell")wsh.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\NoDrives\dword", "789")}
{Dim wshwsh = CreateObject("WScript.shell") wsh.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\NoDrives\dword", "789")}
推荐答案
我会使用类似的东西:
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
这篇关于附加一个 DWORDs 十进制值附加到十六进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!