获取PC中连接的扫描仪列表 [英] Get list of Scanners Connected in PC

查看:88
本文介绍了获取PC中连接的扫描仪列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b我想知道如何获取我的机器中可用的扫描仪列表。然后想在dropdownbox中显示名称。

Hi I want to know how to get list of scanners available in my machine. then want to display the names in dropdownbox.

推荐答案

您可以使用 Windows Image Acquisition Automation Library 。查看下面提到的链接更多信息。



You can use the Windows Image Acquisition Automation Library for that.Check below mentioned links for more information.

WIA.DeviceManager manager = new WIA.DeviceManagerClass();

string deviceName = "";

foreach(WIA.DeviceInfo info in manager.DeviceInfos)

{

if(info.Type == WIA.WiaDeviceType.ScannerDeviceType)

{

foreach(WIA.Property p in info.Properties)

{

if(p.Name == "Name")

{

deviceName = ((WIA.IProperty)p).get_Value().ToString();

Console.WriteLine(deviceName);

}

}

}

}





欲了解更多信息:如何检索已安装的扫描仪



Microsoft Windows Image Acquisition Library v2.0



我希望这会对您有所帮助。



For more info:HOW TO RETRIEVE INSTALLED SCANNER

Microsoft Windows Image Acquisition Library v2.0

I hope this will help to you.


自从我在Windows环境中工作已经很长时间了,但我建议你看看使用WMI

It's been a long time since I've worked in a Windows environment, but I would suggest that you look at using WMI.
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from Win32_PnPEntity");
ManagementObjectCollection coll = searcher.Get();

 foreach (ManagementObject any in coll)
{
  // Check for device name
}


这篇关于获取PC中连接的扫描仪列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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