- void K8POSPrint()
- /// <summary>
- /// PosPrinter object
- /// </summary>
- PosPrinter m_Printer = null;
- //Use a Logical Device Name which has been set on the SetupPOS.
- string strLogicalName = "PosPrinter";
- //Create PosExplorer
- PosExplorer posExplorer = new PosExplorer();
- DeviceInfo deviceInfo = null;
- // Device Info is not null when the printer has the logical name
- deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName);
- m_Printer = (PosPrinter)posExplorer.CreateInstance(deviceInfo);
- catch (Exception ExDevice)
- //Open the device
- //Get the exclusive control right for the opened device. Then the device is disable from other application.
- //Enable the device.
- m_Printer.DeviceEnabled = true;
- // ////CheckHealth.
- // //As using the PrintNormal method, send strings to a printer, and print it [n] is the standard code for starting a new line.
- /// Current Issue Next Line thows an exception - 'It is not initialized'
- m_Printer.PrintNormal(PrinterStation.Receipt, "Hey Now OPOS for .NETn");
- // the next line would throw the exception 'The specified station is not mounted.'
- // m_Printer.PrintNormal(PrinterStation.Slip,"Hey Now Slip OPOS.NETn");
- catch (PosControlException)
- catch (Exception ex)
C# POS.NET PrintNormal() Issue 'It is not Initialized'
a guest Feb 24th, 2012 214 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data