示例#1
0
        public static void SendBytesToPrinter(string szPrinterName, byte[] pBytes)
        {
            var hPrinter = PrinterHelper.GetPrinter(szPrinterName);
            int dwWritten;

            if (!PrinterHelper.WritePrinter(hPrinter, pBytes, pBytes.Length, out dwWritten))
            {
                BombWin32();
            }
            PrinterHelper.EndPrinter(hPrinter);
        }
示例#2
0
 public void WriteData(byte[] data)
 {
     if (_hprinter != IntPtr.Zero)
     {
         int dwWritten;
         if (!PrinterHelper.WritePrinter(_hprinter, data, data.Length, out dwWritten))
         {
             BombWin32();
         }
     }
 }