问题描述
private void show_Click(object sender,RoutedEventArgs e)
{
list1.Items.Clear();
try
{
for (int i = 1; i <= deviceManager.DeviceInfos.Count; i++) // Loop Through the get List Of Devices.
{
/*if (deviceManager.DeviceInfos[i].Type != WiaDeviceType.ScannerDeviceType) // Skip device If it is not a scanner
{
continue;
}*/
list1.Items.Add(deviceManager.DeviceInfos[i].Properties["Name"].get_Value());
}
}
catch (COMException ex)
{
MessageBox.Show(ex.ToString());
}
}
这是将设备添加到列表中的代码,我已经在window_loaded中声明了设备管理器,如下所示
WIA.DeviceManagerClass deviceManager = new WIA.DeviceManagerClass();
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)