add printer for my application

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 :

// 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 ...

Answers


See Command Line Printer Control. You can run this code by Procces.Start(...):

rundll32.exe printui.dll,PrintUIEntry /?

and this link of Microsoft support can be useful:

If you consist on using WMI, the WMI Code Creator tool can help you.


Need Your Help