获取打印机名称
使用GetPrinterNames
方法检索连接到机器上的所有可用打印机。该方法将返回一个字符串数据类型的打印机名称列表。
using IronPrint; using System; using System.Collections.Generic; // Retrieve printers' name List<string> printersName = Printer.GetPrinterNames(); foreach (var printer in printersName) { Console.WriteLine(printer); }
Imports IronPrint Imports System Imports System.Collections.Generic ' Retrieve printers' name Private printersName As List(Of String) = Printer.GetPrinterNames() For Each printer In printersName Console.WriteLine(printer) Next printer
Install-Package IronPrint
使用GetPrinterNames
方法检索连接到机器上的所有可用打印机。该方法将返回一个字符串数据类型的打印机名称列表。