C# code for open/close drawer and printing the receipt at the same time? [closed]

六月ゝ 毕业季﹏ 提交于 2019-12-08 14:20:18

问题


Does any body know how to create a C# application that can open a drawer connected to the computer and print receipt at same time?

Drawer Name: PCD-354 Electronic Cash Drawer

Cash receipt printer: Epson TM-T88v


回答1:


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

try that. maybe it will help you have an overview on things



来源:https://stackoverflow.com/questions/7736676/c-sharp-code-for-open-close-drawer-and-printing-the-receipt-at-the-same-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!