UsbDiscoverer Class |
Namespace: Zebra.Sdk.Printer.Discovery
The UsbDiscoverer type exposes the following members.
Name | Description | |
---|---|---|
UsbDiscoverer |
A class used to discover USB connected Zebra printers. Printers can be accessed either directly or through a USB
printer driver.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetZebraDriverPrinters |
Enumerate locally installed Zebra Designer Drivers.
| |
GetZebraUsbPrinters |
Enumerate currently connected Zebra USB printers.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
using System; using Zebra.Sdk.Comm; using Zebra.Sdk.Printer.Discovery; public class UsbDiscovererExample { public static void Main(string[] args) { try { foreach (DiscoveredPrinterDriver printer in UsbDiscoverer.GetZebraDriverPrinters()) { Console.WriteLine(printer); } foreach (DiscoveredUsbPrinter usbPrinter in UsbDiscoverer.GetZebraUsbPrinters()) { Console.WriteLine(usbPrinter); } } catch (ConnectionException e) { Console.WriteLine($"Error discovering local printers: {e.Message}"); } Console.WriteLine("Done discovering local printers."); } }