大家都见过超市里收音员敲回车后收款机器自动弹出钱箱(装钱的)
谁知道哪个用C#是怎么实现的!
请高手指点

解决方案 »

  1.   

    我以前做过超市系统。这个调用厂商提供的开发包就行了。。一般是个dll....
    那个东西不叫“钱柜”,叫“钱箱”。你一说“钱柜系统”,我还以为是你们在做ktv点歌系统呢。呵呵。by the way ..钱柜实在是贵的要死。不是单位掏钱,打死都不去。。^_^
      

  2.   

    我还以为是KTV的点歌系统呢这个估计首先要了解硬件接口吧?
      

  3.   

    钱柜有一个Com口与电脑相连
    通过C#给这个Com口写个字符串就可以了
      

  4.   

    建个Class如下:
    using System;
    using System.Runtime.InteropServices;
    using System.IO;
    namespace Common
    {
    /// <summary>
    /// POSPrinter 的摘要说明。
    /// </summary>
    public class POSPrinter
    {
    const int OPEN_EXISTING = 3;
    string prnPort ="COM1";
    [DllImport("kernel32.dll", CharSet=CharSet.Auto)]
    private static extern IntPtr CreateFile(string lpFileName,
    int dwDesiredAccess, 
    int dwShareMode, 
    int lpSecurityAttributes,
    int dwCreationDisposition ,
    int dwFlagsAndAttributes ,
    int hTemplateFile);
    public POSPrinter()
    {
    //
    // TODO: 在此处添加构造函数逻辑
    //
    }
    public POSPrinter(string prnPort)
    {
    this.prnPort=prnPort;//打印机端口
    }
    public  string PrintLine(string str)
    {
    IntPtr iHandle = CreateFile(prnPort,  0x40000000, 0, 0, OPEN_EXISTING, 0, 0);
    if(iHandle.ToInt32() == -1)
    {
    return "打开COM1失败";
    }
    else
    {
    FileStream fs = new FileStream(iHandle, FileAccess.ReadWrite);
    StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.Default); 
    //sw.WriteLine(str)//写数据
    //开钱箱
    sw.Write(((char)27).ToString()+"p"+((char)0).ToString()+((char)60).ToString()+((char)255).ToString());
    sw.Close();
    fs.Close();
    return "";
    }
    }
    }
    }调用:
    private void But_Save_Click(object sender, System.EventArgs e)
    {
     string err=PrintLine("");
     if(err!="")
      {
       MessageBox.Show(err);  
      }
    }
      

  5.   

    b/s结构控制Client端的硬件
    估计要做Activex了
      

  6.   

    lldwolf(铁背苍狼) ( ) 信誉:100    Blog   加为好友  2007-06-06 11:19:00  得分: 0  
     
     
       POS机也要B/S了
      
     
    -----------
    偶顶...