我正在使用 Partner SP-550 触摸式计算机 (POS PC) 和 EC-410 钱箱。 POS机上有一个RJ-11端口。它被标记为现金抽屉。我使用 RJ-11 端口将现金抽屉连接到 PC。我的软件是用C#开发的,那么如何用C#编写打开钱箱的命令呢?
最佳答案
您必须将钱箱连接到打印机并将其配置到一个 COM 端口(例如 COM2)并使用下一个代码:
Encoding enc = Encoding.Unicode;
SerialPort sp = new SerialPort();
sp.PortName = "COM2";
sp.Encoding = enc;
sp.BaudRate = 38400;
sp.Parity = System.IO.Ports.Parity.None;
sp.DataBits = 8;
sp.StopBits = System.IO.Ports.StopBits.One;
sp.DtrEnable = true;
sp.Open();
sp.Write(char.ConvertFromUtf32(28699) + char.ConvertFromUtf32(9472) + char.ConvertFromUtf32(3365));
sp.Close();
关于c# - 如何在c#中直接打开钱箱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52325694/