打开/关闭抽屉的C#代码并同时打印收据?

时间:2011-10-12 07:35:07

标签: c# list crystal-reports slidingdrawer thermal-printer

是否有任何机构知道如何创建可以打开连接到计算机的抽屉并同时打印收据的C#应用​​程序?

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

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

2 个答案:

答案 0 :(得分:6)

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();
  }
}
}

试试看。也许它会帮助你对事情有所了解

答案 1 :(得分:3)