mark 汗,终于找到了
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing
State如果值是
0 '开启
512 '取消
所以修改注册表代码
Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing", "State", 512)