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

问题描述

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,

推荐答案


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

09-09 06:18