public static string GetPrinterStatus(string PrinterName) { int intValue = GetPrinterStat ...
网上打了很多方法都无效,以下方法在WIN pro中测试可用: Sub QQ MsgBox 当前默认的打印机名称为 amp Excel.Application.ActivePrinter End Sub 通过直接使用WMI来获取 如此可以得到许多信息,包括状态 联机 脱机以及错误 其中 bool printer.Properties WorkOffline .Value 指示打印机是否脱机 ...
2022-03-12 23:21 0 1048 推荐指数:
public static string GetPrinterStatus(string PrinterName) { int intValue = GetPrinterStat ...
一:获得本地安装的打印机列表 注:(如果在“设备和打印机”中已经添加了局域网的打印机设备,也算是本地安装的打印机;没有添加的则算作局域网打印机) 1,通过 C# 中 PrinterSettings 对象获取,如下,然后通过 foreach 即可遍历 printers ...
List<string> print = Cprinter.GetLocalPrinter(); View Code ...
第一步:添加引用using System.Printing;第二步:代码public static List<string> GetPrintList(){ List& ...
关于这个需求非常早就考虑了,一直没敢下手,也不是不敢,是之前下过一次手可是没有成功。一直过了几个月腾出一些空暇来解决问题。另外说明一下,截止到眼下对于这个需求我还没有一个全然的解决方式。这篇也仅仅是捋下思绪。 关于打印机状态的问题 ...
LocalPrinter.cs Externs.cs ...
原文:https://www.cnblogs.com/Old-Fish/p/6258118.html ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syste ...