Get Printer Names
Use the GetPrinterNames
method to retrieve all available printers connected to the machine. The method will return a list of printer names in string data type.
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
Use the GetPrinterNames
method to retrieve all available printers connected to the machine. The method will return a list of printer names in string data type.
9 .NET API products for your office documents