Vb.net Can';t删除注册表中的值
我创建了一个注册表项值:Vb.net Can';t删除注册表中的值,vb.net,registry,visual-studio-2017,Vb.net,Registry,Visual Studio 2017,我创建了一个注册表项值: My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "TestApp", "C:\myapp.exe") 工作正常,值在注册表中。我试图用 My.Computer.Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "TestApp", "C:\myapp.exe")
工作正常,值在注册表中。我试图用
My.Computer.Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run").DeleteValue("TestApp")
及
它不起作用。我得到一个错误:“值不存在”。。。但该值存在于我的注册表中
如何删除值(但不删除键)?有什么想法吗?如果需要对密钥进行写访问,请将OpenSubKey设置为true,例如,如果要删除值:
Registry.CurrentUser.OpenSubKey(“Software\Microsoft\Windows\CurrentVersion\Run\”,True).DeleteValue(“要删除的值”)这是VBA?不确定“删除”值的确切含义是什么?Visual Basic i使用本教程(第3部分):谢谢。如果需要对该键进行写访问,则OpenSubKey需要一个True(第二个参数)。
My.Computer.Registry.CurrentUser.DeleteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\TestApp")