简体   繁体   English

无法在 DLL 'CIMWin32.dll' 中找到名为 'Reset' 的入口点

[英]Unable to find an entry point named 'Reset' in DLL 'CIMWin32.dll'

[DllImport("CIMWin32.dll")] public static extern UInt32 Reset();

When I Am Calling This Method Then I Getting Exception当我调用这个方法然后我得到异常

Unable to find an entry point named 'Reset' in DLL 'CIMWin32.dll'无法在 DLL 'CIMWin32.dll' 中找到名为 'Reset' 的入口点

I'm not sure what Reset method of CIM you want to import and invoke, but this is how you can call a method in VMI .我不确定您要导入和调用的CIM什么Reset方法,但这是您在VMI调用方法的方式。 Install System.Management package via NuGet.通过 NuGet 安装System.Management包。 Then you need to create an instance of ManagementClass like below:然后你需要创建一个ManagementClass的实例,如下所示:

var NamespacePath = "\\\\.\\ROOT\\cimv2";
var ClassName = "CIM_LogicalDevice";

ManagementClass managementClass = new ManagementClass(NamespacePath + ":" + ClassName);           

managementClass .InvokeMethod("Reset", null);

Of course in the code above, Reset method is not implemented .当然在上面的代码中, 并没有实现Reset 方法 You can find your provider, class, and method in Microsoft Docs .你可以在Microsoft Docs 中找到你的提供者、类和方法。 For eg above, I tried to call the Reset method of CIM_LogicalDevice class.例如上面,我尝试调用CIM_LogicalDevice类的Reset方法。

In the requirement section, you can see the namespace.在需求部分,您可以看到命名空间。

在此处输入图片说明 . .

If you look for the more complicated example of how to invoke WMI class methods, take a look on this example on Microsoft Docs: https://docs.microsoft.com/en-us/configmgr/develop/core/clients/programming/how-to-call-a-wmi-class-method-by-using-system.management如果您要查找有关如何调用 WMI 类方法的更复杂示例,请查看 Microsoft Docs 上的此示例: https : //docs.microsoft.com/en-us/configmgr/develop/core/clients/programming/ how-to-call-a-wmi-class-method-by-using-system.management

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 DLL“ComCtl32”中找到名为“TaskDialogIndirect”的入口点 - Unable to find an entry point named 'TaskDialogIndirect' in DLL 'ComCtl32' C#EntryPointNotFoundException无法在DLL'kernel32.dll'中找到名为'SetDllDirectory'的入口点 - C# EntryPointNotFoundException Unable to find an entry point named 'SetDllDirectory' in DLL 'kernel32.dll' 无法在DLL“opengl32.dll”中找到名为“glBindFramebuffer”的入口点。在MonoGame 3.0中 - Unable to find an entry point named 'glBindFramebuffer' in DLL 'opengl32.dll'. in MonoGame 3.0 无法在DLL“advapi32.dll”模拟异常中找到名为“LogonUser”的入口点 - Unable to find an entry point named 'LogonUser' in DLL 'advapi32.dll' Impersonation exception 在DLL'cvextern'中找不到名为''的入口点 - Unable to find an entry point named '' in DLL 'cvextern' 在DLL'kernel32.dll'中找不到名为'GetProcessID'的入口点 - Unable to find an entry point named 'GetProcessID' in DLL 'kernel32.dll' .net6 无法在 DLL user32.dll 中找到名为“AdjustWindowRectExForDpi”的入口点 - .net6 unable to find an entry point named 'AdjustWindowRectExForDpi' in DLL user32.dll 在DLL'uxtheme.dll'中找不到名为'IsTjemePartDefined'的入口点 - Unable to find an entry point named 'IsTjemePartDefined' in DLL 'uxtheme.dll' 在DLL'WsmSvc.dll'中找不到名为'WSManInitialize'的入口点 - Unable to find an entry point named 'WSManInitialize' in DLL 'WsmSvc.dll' 在DLL'mfplat.dll'中找不到名为'MFCreateMFByteStreamOnStreamEx'的入口点 - Unable to find an entry point named 'MFCreateMFByteStreamOnStreamEx' in DLL 'mfplat.dll'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM