访问被拒绝.(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED) [英] Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)

查看:88
本文介绍了访问被拒绝.(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码:

ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection queryCollection = searcher.Get();

上面的代码抛出以下异常请帮助..我在一些文章中读到这个错误是由于 WMI 损坏而引发的?是这种情况吗?我必须重建 WMI 还是有任何替代方案?或更好的解决方案

Above code throws the following exception please Help..i read in some article that this error are thrown due to WMI corruption?Is this the case?do i have to rebuild WMI or is there any alternate?or a better solution

错误:

访问被拒绝.(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED)

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)

System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32errorCode, IntPtr errorInfo) 在System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32errorCode) 在 System.Management.ManagementScope.InitializeGuts(Objecto) 在 System.Management.ManagementScope.Initialize() 在System.Management.ManagementScope.Connect() 在WebApplication3.lanusers.Button1_Click1(Object sender, EventArgs e) 中C:\用户\用户\文档\视觉工作室2010\Projects\WebApplication3\WebApplication3\lanusers.aspx.cs:line120 IpAddress192.168.1.55HostNamenkn-PC

System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at System.Management.ManagementScope.InitializeGuts(Object o) at System.Management.ManagementScope.Initialize() at System.Management.ManagementScope.Connect() at WebApplication3.lanusers.Button1_Click1(Object sender, EventArgs e) in C:\Users\user\documents\visual studio 2010\Projects\WebApplication3\WebApplication3\lanusers.aspx.cs:line 120 IpAddress192.168.1.55HostNamenkn-PC

推荐答案

错误代码 0x80070005 与 WMI 权限有关.

The Error code 0x80070005 is related to the WMI permissions.

0x8007xxx:源自核心操作系统的错误.WMI 可能由于外部故障返回此类错误,例如,DCOM 安全失败.

0x8007xxx : Errors originating in the core operating system. WMI may return this type of error because of an external failure, for example, DCOM security failure.

为了修复此错误,您必须在客户端和服务器计算机中设置适当的权限.试试这些链接

In order to fix this error you must set the proper permissions in the client and server machines. Try these links

这篇关于访问被拒绝.(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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