Click here to Skip to main content
15,884,598 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.. friends, I have and asp.net web application. In this I want to open Cash Drawer while I am giving the print command to my EPSON Printer.

If anybody have some idea about that, then please give me some example.


Thanks in Advance

Parveen Rathi
Posted
Updated 26-Oct-19 5:44am
v3
Comments
DaveAuld 12-Dec-13 3:32am    
Edit question with make/model of equipment you are using etc.

1 solution

I got some sample code from MSDN using Microsoft.PointOfService package.

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();
        }
    }
}
 
Share this answer
 
v2
Comments
Nelek 26-Oct-19 14:26pm    
It was unanswered but... do you realize that this is over 5 years old?
Dave Kreskowiak 26-Oct-19 18:37pm    
On top of the other comment, this code will only work is the cash drawer is directly connected to the server running the ASP.NET code. It will NOT work if the drawer is connected to the client machine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900