/// <summary>
        /// 打开串口
        /// </summary>
        public bool OpenComPort()
        {
            int  ret   = 0x30;
            byte fbaud = 0; //用该值设置或更改串口通讯控件的波特率

            _autoOpenComPort = Convert.ToBoolean(ConfigurationManager.AppSettings["AutoOpenComPort"]);
            if (_autoOpenComPort)
            {
                ret = StaticClassReaderA.AutoOpenComPort(ref _comPort, ref _readerAddr, fbaud, ref _portIndex); //自动连接串口
            }
            else
            {
                _comPort = Convert.ToInt32(ConfigurationManager.AppSettings["ComPort"]);
                for (int i = 0; i <= 3; i++)
                {
                    fbaud = Convert.ToByte(i);
                    ret   = StaticClassReaderA.OpenComPort(_comPort, ref _readerAddr, fbaud, ref _portIndex);
                }
            }
            if (ret == 0x30 || ret == 0x35)//端口已经打开
            {
                CloseComPort();
                ret = 0x30;
                if (_autoOpenComPort)
                {
                    ret = StaticClassReaderA.AutoOpenComPort(ref _comPort, ref _readerAddr, fbaud, ref _portIndex); //自动连接串口
                }
                else
                {
                    for (int i = 0; i <= 3; i++)
                    {
                        fbaud = Convert.ToByte(i);
                        ret   = StaticClassReaderA.OpenComPort(_comPort, ref _readerAddr, fbaud, ref _portIndex);
                    }
                }
            }
            if (ret == 0)
            {
                return(true);
            }
            else
            {
                Loger.Error(GetReturnCodeMessage(ret));
                return(false);
            }
        }