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

打开/关闭抽屉和同时打印收据的C#代码?,c#,list,crystal-reports,slidingdrawer,thermal-printer,C#,List,Crystal Reports,Slidingdrawer,Thermal Printer,有没有人知道如何创建一个C#应用程序,它可以打开连接到计算机的抽屉,同时打印收据 出票人名称:PCD-354电子现金出票人 现金收据打印机:爱普生TM-T88v using System; using System.Collections.Generic; using System.Text; using Microsoft.PointOfService; namespace POS { public class CashDrawerClass { CashDrawer myCashDra

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

出票人名称:PCD-354电子现金出票人

现金收据打印机:爱普生TM-T88v

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

试试看。也许这会帮助你了解一些事情

我们如何才能给你未指定硬件的代码?有些事情告诉我,你最好阅读硬件/软件的API参考,而不是希望一些随机开发人员恰好熟记API。试着使用此链接,伙计,这会有所帮助。。谢谢,但是我还需要一个打印收据的代码。你知道吗?我不知道,我应该把explorer.GetDevice(“现金抽屉”)改成什么吗?@AllanChua;你找到解决问题的办法了吗?我也有同样的问题。我的现金抽屉与收据打印机相连