打印机状态(如:就绪,缺纸,离线,缺纸,卡纸等) [英] Printer status(like: ready,paper out, offline, low paper,paper jam,etc )

查看:309
本文介绍了打印机状态(如:就绪,缺纸,离线,缺纸,卡纸等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

am使用.net 2.0版本,窗口应用程序
我想获取系统中安装的打印机名称,
然后,如果该打印机已连接到系统
然后我们必须获取打印机状态(例如:就绪,缺纸,离线,缺纸,卡纸等).

使用以下代码获取打印机名称

am using .net 2.0 version, window application
I want to get the printer name which is installed in system,
then if that printer is connected to system
then we have to get the printer status(like: ready,paper out, offline, low paper,paper jam,etc ).

with below code am getting the printer name

string query = string.Format("SELECT * from Win32_Printer");
            ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
            ManagementObjectCollection coll = searcher.Get();
            foreach (ManagementObject printer in coll)
            {
                MessageBox.Show(printer.ToString());
            }



但现在我想获取状态,



but now i want to get the status,

推荐答案

您看到了吗?

http://msdn.microsoft.com/en-us/library/Aa394363 [ ^ ]

我似乎还记得在远程打印机上检索信息时遇到的问题.
Did you see this?

http://msdn.microsoft.com/en-us/library/Aa394363[^]

I seem to recall there being problems with retrieving info on remote printers.


这篇关于打印机状态(如:就绪,缺纸,离线,缺纸,卡纸等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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