C# (C-Sharp) is a programming language developed by Microsoft that runs on the .NET Framework. And used to develop web application, desktop application, mobile application, games application and much more.
C# is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within its .NET initiative led by Anders Hejlsberg.
This tutorial is how to get list of printer name installed in your PC using C# Development.
Please follow the steps.
- First Create a project to in VS (Visual Studio);

Click file and New then Project.
- After that Please follow this steps.
- Click or select Visual C#
- At this point I choice Windows Form App (.NET Framework).
- Create project name “getListPrinterName“
- Then Ok;

- after the project begin.
- add DataGridView to the form to display the list of all Printer name install from you PC’s
- And Button function for Get Execution.

- Now lets Start to the Code. and first install the library that can get PrinterSettings
- Goto Manage NuGets Package
- and search and Install “System.Drawing.Common”

- Code
DataTable dt = new DataTable(); // declate datatable for temp. storage
dt.Columns.Add("PrinterName"); // add column in datatable
foreach (String printer in PrinterSettings.InstalledPrinters) // loop all printer properties get from your PC
{
dt.Rows.Add(printer.ToString()); // stored printer name datatable
}
dataGridView1.DataSource = dt; // display all data from datatable to datagridview
- Sample View

You can freely comment your idea to any suggestion for this blog. thank you and hoping can give a input knowledge for everyone.
Related Topics
Generate Entity Framework Migration Script
In this article, We learn how to create or generate Migration Script. I will show how to do it, and just follow the steps clearly. […]
Consuming Stored Procedure using Entity Framework in .Net Core
In this article, We can learn how to consume Stored Procedure (SP) using Entity Framework in .Net Core. I will show you how to do […]
Cannot be loaded because its operation is blocked by software restriction policies, such as those created by using Group Policy
In this article we learn how to address if you encounter this issue in your development journey. I will show you how, Just follow the […]
Awesome
Thank you for feedback. Please subscribe to get notify for new update and upload.
Nice Job!
Thank you for feedback. Please subscribe to get notify for new update and upload.