错误:访问被拒绝 [英] Error: Access is denied

查看:165
本文介绍了错误:访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到此错误访问被拒绝. (获取HRESULT的异常:0x80070005(E_ACCESSDENIED)),同时获取硬件信息

I am getting this error Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) while getting the hardware information

ConnectionOptions co = new ConnectionOptions();
co.Impersonation = ImpersonationLevel.Impersonate;
co.EnablePrivileges = true;
co.Authentication = AuthenticationLevel.Default;
ManagementScope ms = new ManagementScope("\\\\192.168.1.9\\root\\cimv2", co);  
ms.Connect();
                
ObjectQuery ob = new ObjectQuery("select * from Win32_Processor");
ManagementObjectSearcher searcher4 = new ManagementObjectSearcher(ms,ob);
foreach (ManagementObject objmgmt3 in searcher4.Get())
{
   Response.Write("Processor:" + objmgmt3.GetPropertyValue("Name"));
}


这是我正在尝试获取硬件信息的代码....

谁能帮帮我.....


This is the code that i am trying to fetching hardware information....

can anyone please help me.....

推荐答案

您正尝试访问Intranet服务器.看起来像一个安全许可问题.

1.检查是否打开了某些防火墙,并且正在系统上对其进行停止
2.确认所使用的模拟帐户具有系统上必要的权限才能访问信息.
You are trying to access a intranet server. Looks like a security permission issue.

1. Check if some firewall is on and working on the system stopping it
2. Verify that the impersonation account used has needed rights on the system to access information.


这篇关于错误:访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆