我有一个扫描文档的应用程序,我正在使用Windows Image Acquisition。我应用了皮特·布朗写的this article中的指令,这很有趣,但在我的例子中,我有一个无线扫描器,我的代码抛出了一个异常,它找不到设备。我尝试使用我找到的代码枚举设备:
public static List<string> GetDevices()
{
List<string> devices = new List<string>();
WIA.DeviceManager manager = new WIA.DeviceManager();
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
devices.Add(info.DeviceID);
}
return devices;
}但是返回的列表是空的。
那么这个问题有什么解决方案吗?
发布于 2019-09-25 17:31:48
当我使用
WIA.DeviceManager manager = new WIA.DeviceManagerClass();而不是
WIA.DeviceManager manager = new WIA.DeviceManager();manager.DeviceInfos包括我的网络扫描仪。
https://stackoverflow.com/questions/30143615
复制相似问题