I need to get the list of all printers that connect to computer?
How I can do it in C#, WinForms?
You can also use the LocalPrintServer class. See: System.Printing.LocalPrintServer
public List InstalledPrinters
{
get
{
return (from PrintQueue printer in new LocalPrintServer().GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local,
EnumeratedPrintQueueTypes.Connections }).ToList()
select printer.Name).ToList();
}
}
As stated in the docs: Classes within the System.Printing namespace are not supported for use within a Windows service or ASP.NET application or service.