示例#1
0
        public bool Connect(ConnectType ConnectType)
        {
            try
            {
                RFIDReader.SetAPILanguageType(eAPILanguage.English);
                Stop();
                Disconnect();
                bool isConnect = false;
                switch (ConnectType)
                {
                case ConnectType.USB:
                    ConnId    = RFIDReader.GetUsbHidDeviceList()[0];
                    isConnect = RFIDReader.CreateUsbConn(ConnId, Handle, Log);
                    break;

                case ConnectType.WiFi:
                    ConnId    = TcpConnID;
                    isConnect = RFIDReader.CreateTcpConn(ConnId, Log);
                    break;
                }
                return(isConnect && RFIDReader.CheckConnect(ConnId));
            }
            catch { return(false); }
        }