本文介绍了如何在C#中查找打印机类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 如何找到PC中安装的打印机类型,无论是c#中的点矩阵,激光还是喷墨?how can I find the printer type which is installed in our PC, whether is it dot-Matrix, laser or inkjet in c#?推荐答案以下类别为您提供打印机是点矩阵打印机,激光打印机还是喷墨打印机:The following class gives you whether the printer is dot-Matrix, laser or inkjet:using System;using System.Management;namespace ConsoleDemo{class Printer{ public enum TechnologyType { Other = 1, Unknown = 2, Electrophotographic_LED = 3, Electrophotographic_Laser = 4, Electrophotographic_Other = 5, Impact_Moving_Head_Dot_Matrix_9pin = 6, Impact_Moving_Head_Dot_Matrix_24pin = 7, Impact_Moving_Head_Dot_Matrix_Other = 8, Impact_Moving_Head_Fully_Formed = 9, Impact_Band = 10, Impact_Other = 11, Inkjet_Aqueous = 12, Inkjet_Solid = 13, Inkjet_Other = 14, Pen_ = 15, Thermal_Transfer = 16, Thermal_Sensitive = 17, Thermal_Diffusion = 18, Thermal_Other = 19, Electroerosion = 20, Electrostatic = 21, Photographic_Microfiche = 22, Photographic_Imagesetter = 23, Photographic_Other = 24, Ion_Deposition = 25, eBeam = 26, Typesetter = 27 } public static void GetPrinterInfo() { var printerQuery = new ManagementObjectSearcher("SELECT * from Win32_Printer"); foreach (var printer in printerQuery.Get()) { var name = printer.GetPropertyValue("Name"); var status = printer.GetPropertyValue("Status"); var isDefault = printer.GetPropertyValue("Description"); var MarkingTechnology = printer.GetPropertyValue("MarkingTechnology"); var CurrentCapabilities = (string )printer.GetPropertyValue("CurrentCapabilities"); Console.WriteLine("Name:{0} |(Status: {1} | Description: {2}| Technology: {3} | {4} ", name, status, isDefault, MarkingTechnology , CurrentCapabilities); } }}}枚举TechnologyType为您提供打印机技术的类型。The enum TechnologyType gives you the type of printer technology.有关更多信息,请参见: Win32_Printer类For more information review: Win32_Printer class 这篇关于如何在C#中查找打印机类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-09 06:54