ARTICLE

Get All Installed Printers in C#

Posted by Ibrahim Ersoy Articles | .NET Assemblies July 09, 2012
Tags: C#, Printers
Assuming you need to retrieve all installed printers,you can do it by using PrinterSettings class
Reader Level:
Download Files:
 

This class locates in System.Drawing.Printing namespace 

so you need to add reference System.Drawing and then import it with using statement:


using System.Drawing.Printing;

To get all the printers available,you need to iterate the string values through PrinterSettings

 

For example:

Add a ListBox to your windows application and then use foreach statement for iteration:


foreach (string printname in PrinterSettings.InstalledPrinters)
{
listBox1.Items.Add(printname);
}



This will show you all the available Printers installed on your computer as seen below:

art2.png

Because i've not installed any physical printers on my computer it shows the printer services.

Login to add your contents and source code to this article
comments
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.