Windows注册表创建子项 [英] Windows Registry Create Subkey

查看:111
本文介绍了Windows注册表创建子项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个函数:



I created a function:

Public Sub CreateRegistrySubKey(ByVal iSubKeyName As String)
    Dim regKey As RegistryKey
    regKey = My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
    regKey.CreateSubKey(iSubKeyName)
    regKey.Close()
End Sub





当然,模块有

在标题中输入Microsoft.Win32。



在可执行部分,我称之为:





Of course, the module has
"Imports Microsoft.Win32" in the header.

In the executable portion, I call this as:

CreateRegistrySubKey("MyNew Application")





我似乎无法使其正常工作。它不会在注册表中创建新的子项。



我做错了什么?



I can't seem to get this to work correctly. It doesn't create the new subkey in the registry.

What am I doing wrong?

推荐答案

如果您的可执行文件是32位,它可能属于HKLM \ Software /\\ Wow6432Node。
If your executable is 32 bits, it may fall into HKLM\Software\Wow6432Node.


这篇关于Windows注册表创建子项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆