C# 获取所有打印机】的更多相关文章

List<string> print = Cprinter.GetLocalPrinter(); /// <summary> /// 获取所有打印机 /// </summary> public class Cprinter { private static PrintDocument fPrintDocument = new PrintDocument(); ///<summary> ///获取本地默认打印机名称 ///</summary> pu…
Delphi获取默认打印机名称及端口 在前段时间写的收银系统中由于目前市场上很多电脑主板上已经没有并口,而POS机却又需要并口,所以目前需要用PCI转接卡,这个就导致不同门店使用的端口就有可能不同,这就给我们程序中弹出钱箱的指令带来一定的难度.所以就通过获取Window自带的默认,得出打印机信息. 在Windows文件下有个win.ini,里面自带默认打印机的信息.通过调用API函数Getprofilestring这个函数获取打印机信息.   在界面上拖个button,在其单击事件中写: pro…
获取WINDOWS打印机列表 如何知道WINDOWS已经安装了哪些打印机? 1) usesVcl.Printers 2) Printer.Printers  // property Printers: TStrings read GetPrinters; 3)…
如何获取默认打印机的状态,包括缺纸.卡纸.无连接等状态,还有将某文件打印后,如何得知打印成功? Option ExplicitDeclare Function MapPhysToLin Lib "WinIo.dll" (ByVal PhysAddr As Long, ByVal PhysSize As Long, ByRef PhysMemHandle) As LongDeclare Function UnmapPhysicalMemory Lib "WinIo.dll&qu…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Med…
引用 using System.Drawing.Printing; //代码 PrintDocument prtdoc = new PrintDocument(); string strDefaultPrinter = prtdoc.PrinterSettings.PrinterName;//获取默认的打印机名 foreach (string ss in PrinterSettings.InstalledPrinters) { ///在列表框中列出所有的打印机, this.listBox1.It…
本文主要介绍如何获取以及设置系统的默认打印机. 1.获取系统中的所有打印机 获取系统中的所有打印机可以使用EnumPrinters()函数,该函数可以枚举全部的本地.网络打印机信息.其函数原型为: BOOL WINAPI EnumPrinters( DWORD Flags, LPSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned ); 其中,参数Flags可以…
一:获得本地安装的打印机列表 注:(如果在"设备和打印机"中已经添加了局域网的打印机设备,也算是本地安装的打印机:没有添加的则算作局域网打印机) 1,通过 C# 中 PrinterSettings 对象获取,如下,然后通过 foreach 即可遍历 printers: PrinterSettings.StringCollection printers = System.Drawing.Printing.PrinterSettings.InstalledPrinters; 2,Print…
C# 获取打印机列表以及默认打印机.串口列表. /// <summary> /// 获取本地已安装的打印机 /// </summary> /// <returns></returns> public string GetPrinter() { string strList = ""; System.Drawing.Printing.PrinterSettings.StringCollection PrinterList = System.…
由于打印机千差万别,打印机执行的标准也不一样,LODOP获取的打印状态码也可能不同,安装了个打印机驱动实际测试一下,测试的打印机驱动是Brother Color Type3 Class Driver. 用LODOP获取打印机状态码,和打印机队列的状态对比一下,分别是打印机错误,正在排队,和脱机.1.该打印机队列里该任务呈现的是:错误-正在打印 用LODOP获取的打印状态码8210,状态码含义是 错误-正在打印LODOP获取的和打印机队列一致.2.该打印机队列里该任务呈现的是:状态是空,但是有打印…