Ejemplo n.º 1
0
 public Demo()
 {
     InitializeComponent();
     foreach (string s in pattername)
     {
         cbPattern.Items.Add(s);
     }
     cbPattern.SelectedIndex = 4;
     if (Ret_Value.INIT_OK != EM1300DLL.EM1300SerialInit(Seriao_Port.COM2))
     {
         MessageBox.Show("启动通信失败");
         Application.Exit();
     }
     exitThreadEvent = EM1300DLL.CreateEvent(0, 1, 0, 0);
     readThread      = new Thread(new ThreadStart(ReadBarcode));
     readThread.Start();
     KeyPreview = true;
 }
Ejemplo n.º 2
0
        public Scan()
        {
            InitializeComponent();

            if (Ret_Value.INIT_OK != EM1300DLL.EM1300SerialInit(Seriao_Port.COM5))
            {
                MessageBox.Show("启动通信失败");
                Application.Exit();
            }

            resumeEvent = new ManualResetEvent(false);
            resumeEvent.Reset();
            paused     = true;
            readThread = new Thread(new ThreadStart(ReadBarcode));
            readThread.Start();

            //Pause();

            ExePath    = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
            bmp_up     = new Bitmap(ExePath + @"\up-ReadBarcode.bmp");
            bmp_down   = new Bitmap(ExePath + @"\down-ReadBarcode.bmp");
            KeyPreview = true;
        }