我需要将PRN文件打印到喷墨打印机的帮助 [英] I need help for printing prn file to inkjet printer

查看:94
本文介绍了我需要将PRN文件打印到喷墨打印机的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个餐厅管理项目.

我应该打印帐单和项目订购的详细信息.
有两台喷墨打印机,一台用于在厨房打印厨房订购的详细信息,另一台用于在收银台打印账单.

我每次都创建prn文件.
我想将每个文件打印到相应的打印机,因此必须给打印机起一个名字.

怎么做?

请为这个问题提供任何帮助

谢谢您

I am doing a Restaurant management project.

I should be printing the bill and item ordered details.
There are two inkjet printers, one for printing kitchen ordered details in the kitchen and another for Bill printing in cashier counter.

I am creating prn file every time.
I want to print each file to the corresponding printer and so must give the printer a name.

How to do it?

Please any help for this problem

Thanking you

推荐答案

您可以使用ObjectQuery和System.Management来检索网络上的打印机,就像这样

You can use an ObjectQuery using System.Management to retrieve printers on the network, like this

// Use the ObjectQuery to get the list of configured printers
            System.Management.ObjectQuery query =
                new System.Management.ObjectQuery("SELECT * FROM Win32_Printer");
 
            System.Management.ManagementObjectSearcher searcher =
                new System.Management.ManagementObjectSearcher(oquery);
 
            System.Management.ManagementObjectCollection collection = searcher.Get();
 
            foreach (ManagementObject mo in collection)
            {
                System.Management.PropertyDataCollection pdc = mo.Properties;
                foreach (System.Management.PropertyData pd in pdc)
                {
                    if ((bool)mo["Network"])
                    {
                        cmbPrinters.Items.Add(mo[pd.Name]);
                    }
                }
            }



希望对您有帮助



Hope this helps


这篇关于我需要将PRN文件打印到喷墨打印机的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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