using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Data;
using System.Net;
using System.IO;

using System.IO.Ports;

using System.Collections.Generic;
using System.Text;

using System.Threading;
using System.Configuration;

namespace SyUpLoad
{
    /// <summary>
    /// 扫描枪
    /// </summary>
    partial class PartLoad
    {
        string PortName = ConfigurationManager.AppSettings["PortName"];
        int ReadTimeout = Convert.ToInt32( ConfigurationManager.AppSettings["ReadTimeout"]);
        int BaudRate = Convert.ToInt32(ConfigurationManager.AppSettings["BaudRate"]);
        int ScannerTrim = Convert.ToInt32(ConfigurationManager.AppSettings["ScannerTrim"]);


        /// <summary>
        /// 处理条码信息
        /// </summary>
        /// <param name="barCode"></param>
        private void BarCode(string barCode)
        {
            try
            {
                barCode = barCode.Replace("\r\n", "");
                textBox_barcode.Text = barCode;

                button_barcode_Click(null, null);
                //string sendStr = "BarCode|Bar|" + ApplicationConfig.OpName + "|" + barCode;
                //发送UDP到MES通讯服务器
                //ApplicationLog.WriteLog("11111111111111");
                //asySendMessage(sendStr);
            }
            catch (Exception err)
            {
               // ApplicationLog.WriteLog(err, "BarCode");
            }
        }
    }
}
