如何获取物理和网络打印机列表 [英] How to get a list of physical and network printers

查看:47
本文介绍了如何获取物理和网络打印机列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello all



我正在用C#开发一个Windows应用程序。我只想要一个物理和网络打印机列表,但是当我执行我的代码时,它会给我所有的打印机,包括XPS,MDI,FAX

如何避免它?



这是我的代码

Hello all

i am developing a windows application in C#. i want a list of physical and network printers only but when i execute my code it will give me all printers including XPS, MDI, FAX
how to avoid it ?

here is my code

foreach (String printer in PrinterSettings.InstalledPrinters)
            {
                    cmbPrinter.Items.Add(printer.ToString());
            }





谢谢

koolprasad



Thanks
koolprasad

推荐答案

如果我是对的,所有打印机都存储在Active Directory中。因此,在网上快速搜索会产生链接 [ ^ ]
If I'm right, all your printers are stored in Active Directory. So a quick search on the web resulted in this link[^]


这篇关于如何获取物理和网络打印机列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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