Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Get all printer installed on your machine in c# .net 2.0

Author: DevAsp Team
Download Source Code : 691_GetAllPrinters.zip

In this simple article you will learn how you can get all printer installed on your machine or on LAN.

Simply just create New Project of C#.

 

Now drag one Button, one Listbox on the form

 

Now just write code on Form Load Event

 

private void Form1_Load(object sender, EventArgs e)

        {

            this.Text = "DevAsp Printer Setting";

            this.button1.Text ="Load All Printers";

        }

 

Now write code on Button Click Event

 

private void button1_Click(object sender, EventArgs e)

        {

            try

            {

                foreach (String strPrinter in System.Drawing.Printing.PrinterSettings.InstalledPrinters)

                {

                    listBox1.Items.Add(strPrinter);

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }

        }

 

 

 

Article Comments
Hi
I would like to know how to remove an Installed Printer on a machine.
could you please help me regarding this.

Posted on 8/8/2007 12:33:17 AM by Ramnath

It works OK in Windows Form.
I'm using asp.net so how can I get all installed printers on LAN.

Posted on 10/17/2007 5:35:07 AM by Manach

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Working with Calculator through some other application in C#.net 2.0.

Disclaimer - Privacy
© 2002-2017 DevASP.net