Click or drag to resize

UsbDiscoverer Class

A class used to discover USB connected Zebra printers. Printers can be accessed directly or through a Zebra Designer printer driver if your printer supports the driver.
Inheritance Hierarchy
SystemObject
  Zebra.Sdk.Printer.DiscoveryUsbDiscoverer

Namespace:  Zebra.Sdk.Printer.Discovery
Assembly:  SdkApi_Desktop (in SdkApi_Desktop.dll) Version: 2.14.1989
Syntax
public class UsbDiscoverer

The UsbDiscoverer type exposes the following members.

Constructors
  NameDescription
Public methodUsbDiscoverer
A class used to discover USB connected Zebra printers. Printers can be accessed either directly or through a USB printer driver.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetZebraDriverPrinters
Enumerate locally installed Zebra Designer Drivers.
Public methodStatic memberGetZebraUsbPrinters
Enumerate all currently connected Zebra USB printers.
Public methodStatic memberGetZebraUsbPrinters(DiscoveredPrinterFilter)
Enumerate currently connected Zebra USB printers that meet the specified DiscoveredPrinterFilter criteria.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
using System;
using Zebra.Sdk.Card.Printer.Discovery;
using Zebra.Sdk.Comm;
using Zebra.Sdk.Printer.Discovery;

public class UsbCardDiscovererExample {

    public static void Main(string[] args) {
        try {
            foreach (DiscoveredUsbPrinter usbPrinter in UsbDiscoverer.GetZebraUsbPrinters(new ZebraCardPrinterFilter())) {
                Console.WriteLine(usbPrinter);
            }
        } catch (ConnectionException e) {
            Console.WriteLine($"Error discovering local printers: {e.Message}");
        }

        Console.WriteLine("Done discovering local printers.");
    }
}
See Also