【发布时间】:2017-10-30 00:13:35
【问题描述】:
我得到:访问被拒绝 HKEY_LOCAL_MACHINE
这段代码有什么问题?
var key = "SOFTWARE\\Microsoft\\Expression\\Encoder\\4.0";
using (var registryKey = Registry.LocalMachine.OpenSubKey(key))
{
if (registryKey == null)
{
using (var newKey = Registry.LocalMachine.CreateSubKey(key))
{
CheckInstallKey(newKey);
}
}
else
{
CheckInstallKey(registryKey);
}
}
错误:
【问题讨论】: