我有一个程序可以删除HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
密钥中的特定注册表值。
删除这些注册表值的代码位于FormClosed
,但在程序关闭后几秒钟内会重新创建值。
如果你知道如何解决这个问题,那么如果你能告诉我的话会很棒!
这是我的代码:
Dim key As Microsoft.Win32.RegistryKey
Dim keypath As String = "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store"
key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(keypath, True)
If key.GetValue("value here") Is Nothing Then
Else
key.DeleteValue("value here")
End If