Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I want to add a printer for my application to the network printers list.I mean something like what Adobe PDF do.

I could get all printers in the network by the following code :

C#
// Use the ObjectQuery to get the list of configured printers
  System.Management.ObjectQuery oquery =
  new System.Management.ObjectQuery("SELECT * FROM Win32_Printer");

  System.Management.ManagementObjectSearcher mosearcher =
  new System.Management.ManagementObjectSearcher(oquery);

  System.Management.ManagementObjectCollection moc = mosearcher.Get();

  foreach (ManagementObject mo in moc)
   {
      lstPrinter.Items.Add(mo["Name"]);
   }


I do not know what should i search to find this.please help ...
Posted
Updated 13-Jul-12 22:57pm
v2
Comments
Richard MacCutchan 14-Jul-12 5:09am    
When you say "add printer" do you mean add a new printer driver?
Yvan Rodrigues 15-Jul-12 17:51pm    
You mean you want to add your own virtual printerm like the "Adobe PDF" printer; or are you just trying to enumerate printer devices?
M_Mogharrabi 17-Jul-12 0:22am    
Hi, Yvan Rodrigues,thanks for your reply. yes i mean the first one.I want to add a virtual printer for my application.please describe how should i do that?

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