C#如何操作钱箱
钱箱是通过RJ11接口接在POS机上面的,C#里如何操作钱箱? --------------------编程问答-------------------- 硬件商应该有接口的 --------------------编程问答-------------------- show me the money--------------------编程问答-------------------- 有,但是只有dll和demo,却没有源码,不懂调用的是什么函数。 --------------------编程问答--------------------
BLACK SHEEP WALL --------------------编程问答--------------------
有DLL和Demo就足够了
--------------------编程问答-------------------- 有DLL和Demo就足够了
--------------------编程问答-------------------- 对高手来说,没有破不了的钱箱
--------------------编程问答--------------------
如何操作,请大虾指点 --------------------编程问答--------------------
1、在项目中直接引用dll(托管的情况下直接引用,非托管的情况下使用DllImport)
2、在你的代码中调用dll中提供的函数
当然,你得对dll提供的函数有所了解,一般都有说明文档,没有就看demo。
给分吧,写的好累啊! --------------------编程问答-------------------- 都有dll借口了还有demo你还要怎么样?
建议再去下载一个说明书,里面会有简单的api使用说明
另外可以打电话给开发商的技术部门,如果他们还闲的话说不定会指点你一下 --------------------编程问答--------------------
打开dome 看源码 --------------------编程问答-------------------- 钱箱?我给你操作去吧?哈哈!不过还真不懂,来学习一下 --------------------编程问答--------------------
只有demo,没有源码,也没有说明书 --------------------编程问答-------------------- POS_KickOutDrawer(0x00, 100, 80);看看你的dll有没有这个函数吧。开钱箱的函数。 --------------------编程问答-------------------- public static void openMoneyBox(string p_PrintName, byte[] p_Byte)
{
if (p_PrintName != null && p_PrintName.Length > 0)
{
IntPtr _PrintHandle;
IntPtr _JobHandle = Marshal.AllocHGlobal(100);
if (OpenPrinter(p_PrintName, out _PrintHandle, IntPtr.Zero))
{
ADDJOB_INFO_1 _JobInfo = new ADDJOB_INFO_1();
int _Size;
AddJob(_PrintHandle, 1, _JobHandle, 100, out _Size);
_JobInfo = (ADDJOB_INFO_1)Marshal.PtrToStructure(_JobHandle, typeof(ADDJOB_INFO_1));
//System.IO.File.WriteAllBytes(p_PrintName, p_Byte);
System.IO.File.WriteAllBytes(_JobInfo.lpPath, p_Byte);
ScheduleJob(_PrintHandle, _JobInfo.JobID);
ClosePrinter(_PrintHandle);
Marshal.FreeHGlobal(_JobHandle);
}
}
}
string printName = Commons.readIniFile("小票打印设置", "device_name", Utilty.iniFilePath());
if (string.IsNullOrEmpty(printName))
{
XtraMessageBox.Show("未设置打印机名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
string str = ((char)27).ToString() + "p" + ((char)0).ToString() + ((char)60).ToString() + ((char)255).ToString();
byte[] data = System.Text.Encoding.Default.GetBytes(str);
openMoneyBox(printName, data);
补充:.NET技术 , C#