Fetch all installed Printers in c#
To fetch all installed Printers list in C#, you should add reference of System.Drawing.Printing add same as a name space in our program.
In System.Drawing.Printing, InstalledPrinters is available under PrinterSettings class as shown below:
Below is the code snippet for Fetch all installed Printers in c#
using System;
using System.Drawing.Printing;
namespace GetAllInstalledPrinters
{
class Program
{
static void Main(string[] args)
{
Console.Title = "Get all installed Printers in your computer.";
Console.WriteLine("Get all installed Serial Ports in your computer.");
foreach (string printname in PrinterSettings.InstalledPrinters)
{
Console.WriteLine(printname);
}
Console.ReadKey();
}
}
}
Output:
