I need to get the list of all printers that connect to computer?
How I can do it in C#, WinForms?
Open a new command prompt. Type the following command: wmic printer list brief . This will show the list of installed printers.
On most modern computers, you can use a tool called netstat to list the devices on your network. On Windows, type "cmd" in the search box on the Start Menu or task bar, then click the icon to load the Windows command prompt. Type "netstat" to list active connections, which may include your printer.
For Windows 10, click on Start > Settings > Devices > Printer & scanners. Older operating system will find their printers under Control Panel, Devices and printers.
The Get-Printer cmdlet retrieves a list of printers installed on a computer. You can also use Get-Printer to retrieve the properties of a single printer, and then use that information as input into other cmdlets.
Try this:
foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters) { MessageBox.Show(printer); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With