Mag
|
The MagCardReader type exposes the following members.
Name | Description | |
---|---|---|
Read | Activates the device's magnetic card reader, if present, and waits for a card to be swiped. |
using System; using Zebra.Sdk.Comm; using Zebra.Sdk.Device; using Zebra.Sdk.Printer; public class MagCardReaderExample { public static void Main(string[] args) { Connection connection = new TcpConnection("192.168.1.100", TcpConnection.DEFAULT_CPCL_TCP_PORT); try { connection.Open(); ZebraPrinter printer = ZebraPrinterFactory.GetInstance(connection); MagCardReader mcr = MagCardReaderFactory.Create(printer); if (mcr != null) { string[] trackData = mcr.Read(10 * 1000); Console.WriteLine("Track1: " + trackData[0]); Console.WriteLine("Track2: " + trackData[1]); Console.WriteLine("Track3: " + trackData[2]); } } catch (ConnectionException e) { Console.WriteLine(e.ToString()); } catch (ZebraPrinterLanguageUnknownException e) { Console.WriteLine(e.ToString()); } finally { connection.Close(); } } }