当前位置: 代码迷 >> .NET Framework >> c# Winform 条形扫描器如何弄
  详细解决方案

c# Winform 条形扫描器如何弄

热度:141   发布时间:2016-05-02 01:03:45.0
c# Winform 条形扫描器怎么弄?
有个项目要用到条形扫描器来扫描 然后跟数据判断 怎么弄啊 
但不知道怎么弄
请高手指点下
给点案例 谢谢!

------解决方案--------------------
C# code
private GraphicsPath GetGraphicsPath(Rectangle rc, int r)        {            int x = rc.X, y = rc.Y, w = rc.Width, h = rc.Height;            GraphicsPath path = new GraphicsPath();            path.AddArc(x, y, r, r, 180, 90);                //            path.AddArc(x + w - r, y, r, r, 270, 90);            //            path.AddArc(x + w - r, y + h - r, r, r, 0, 90);        //            path.AddArc(x, y + h - r, r, r, 90, 90);            //            path.CloseFigure();            return path;        }        private void panelContaioner_Paint(object sender, PaintEventArgs e)        {            Graphics g = e.Graphics;            Rectangle rc = new Rectangle(0+2, 0+2, this.Width - 10, this.Height -5);            SolidBrush brush = new SolidBrush(Color.Black);            Pen pen = new Pen(brush, 1);            g.DrawPath(pen, this.GetGraphicsPath(rc, 20));        }
------解决方案--------------------
条码扫描只要在输入的地方获得焦点,就可以把扫描到的条形码获取到,然后触发相应的事件,项目中基本上不需要什么代码的实现,很简单的
------解决方案--------------------
条形扫描器其实就一输入设备,安装好驱动后,可用记事本试试,它自动把条码数据读取输入,以前用过,很简单。
------解决方案--------------------
http://blog.csdn.net/long102/archive/2007/10/31/1859305.aspx
  相关解决方案