Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3' is denied. 我在C#程序运行的时候要更改IE的安全级别,以可以运行未签名的ActiveX Control.
protected void Application_Start(object sender, EventArgs e)
{
string key = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3";//修改IE安全级别
Registry.SetValue(key, "1201", 0);
Registry.SetValue(key, "1200", 0);
Registry.SetValue(key, "1405", 0);
Registry.SetValue(key, "1004", 0);
Registry.SetValue(key, "1001", 0); }
protected void Application_Start(object sender, EventArgs e)
{
string key = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3";//修改IE安全级别
Registry.SetValue(key, "1201", 0);
Registry.SetValue(key, "1200", 0);
Registry.SetValue(key, "1405", 0);
Registry.SetValue(key, "1004", 0);
Registry.SetValue(key, "1001", 0); }
否则服务器就没安全可言了
网站的应用程序池的标识改为本地系统进行测试
<identity impersonate="true" userName="administrator" password="密码"/>
修改\Machine.config文件ProcessModel段中的UserName,
把Machine改成SYSTEM.