Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net Can';t删除注册表中的值_Vb.net_Registry_Visual Studio 2017 - Fatal编程技术网

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")