Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all

i am developing a windows application in C#. i want a list of physical and network printers only but when i execute my code it will give me all printers including XPS, MDI, FAX
how to avoid it ?

here is my code
C#
foreach (String printer in PrinterSettings.InstalledPrinters)
            {
                    cmbPrinter.Items.Add(printer.ToString());
            }


Thanks
koolprasad
Posted
Comments
BillWoodruff 25-Sep-13 12:47pm    
Do you have the issues of discovering all printers of all types across your network solved ?

Or, is your problem simply one of discriminating what the found printers are by type ?

Obviously PrinterSettings.InstalledPrinters in System.Drawing.Printing doesn't give you what you need; have you tried using the Win32_Printer object in WMI ?

1 solution

If I'm right, all your printers are stored in Active Directory. So a quick search on the web resulted in this link[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900