关于GetUSBDevices的C#问题。为什么会抛出异常错误? [英] C# Question about GetUSBDevices. Why does it throw an exception error?

查看:91
本文介绍了关于GetUSBDevices的C#问题。为什么会抛出异常错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

// The following code works on some Windows computers, 32 and 64 bit
//  and not on other computers of the same 32 and 64 bit.
try
{
    WinDevicesWiFi.GetUSBDevices();
    // This searches for all MCP2200 Microchip devices by VID.
}
catch
{
    MessageBox.Show("The exception error is caused by" +
        "WinDevicesWiFi.GetUSBDevices() );
}

推荐答案

引用:

搜索...按VID

当谈到供应商ID(VID)时,Windows Management Instrumentation(WMI)会参与其中。 WMI经常被破坏。

因此我建议在显示例外的计算机上修复WMI.Google / Bing等将帮助您找到该程序的步骤。

When it comes to the Vendor ID (VID), Windows Management Instrumentation (WMI) uses to be involved. And it does happen rather often that WMI is corrupt.
Hence I suggest to repair WMI on the computers showing an exception. Google/Bing etc. will help you find out the steps for that procedure.

这篇关于关于GetUSBDevices的C#问题。为什么会抛出异常错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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