c#代码用于同时打开/关闭抽屉和打印收据

本文关键字:打印 用于 代码 | 更新日期: 2023-09-27 18:10:57

有没有人知道如何创建一个c#应用程序,可以打开连接到计算机的抽屉,同时打印收据?

抽屉名称:PCD-354电子现金抽屉

现金收据打印机:Epson TM-T88v

c#代码用于同时打开/关闭抽屉和打印收据

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.PointOfService;
namespace POS
{
public class CashDrawerClass
{
  CashDrawer myCashDrawer;
  PosExplorer explorer;
 public CashDrawerClass()
{
 explorer = new PosExplorer(this);
 DeviceInfo ObjDevicesInfo = explorer.GetDevice("CashDrawer");
 myCashDrawer = explorer.CreateInstance(ObjDevicesInfo);
}
 public void OpenCashDrawer()
  {
  myCashDrawer.Open();
  myCashDrawer.Claim(1000);
  myCashDrawer.DeviceEnabled = true;
  myCashDrawer.OpenDrawer();
  myCashDrawer.DeviceEnabled = false;
  myCashDrawer.Release();
  myCashDrawer.Close();
  }
}
}

试试。也许它会帮助你对事物有一个概述