private static void openCashDrawer1() { string printerName = DTsetting.Rows[0]["windows_printer_name"].ToString(); byte[] codeOpenCashDrawer = new byte[] { 27, 112, 48, 55, 121 }; IntPtr pUnmanagedBytes = new IntPtr(0); pUnmanagedBytes = Marshal.AllocCoTaskMem(5); Marshal.Copy(codeOpenCashDrawer, 0, pUnmanagedBytes, 5); RawPrinterHelper.SendBytesToPrinter(printerName, pUnmanagedBytes, 5); Marshal.FreeCoTaskMem(pUnmanagedBytes); }
private void openCashDrawer1() { string printerName = Class.PosPrint.windowsPrinterName1; byte[] codeOpenCashDrawer = new byte[] { 27, 112, 48, 55, 121 }; IntPtr pUnmanagedBytes = new IntPtr(0); pUnmanagedBytes = Marshal.AllocCoTaskMem(5); Marshal.Copy(codeOpenCashDrawer, 0, pUnmanagedBytes, 5); RawPrinterHelper.SendBytesToPrinter(printerName, pUnmanagedBytes, 5); Marshal.FreeCoTaskMem(pUnmanagedBytes); }