Ejemplo n.º 1
0
        /// <summary>
        /// 登出门禁主机
        /// </summary>
        /// <param name="userInfo">门禁主机信息</param>
        public bool LoginOut(CHDDoorUseInfo userInfo)
        {
            CHDOperate op = GetOPByIP(userInfo.DeviceIp);

            if (null != op)
            {
                return(op.DisConnectionDevice());
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 寻卡号
        /// </summary>
        /// <param name="com">通讯端口</param>
        /// <returns>返回卡号</returns>
        public string ReaderCardNum(string com)
        {
            CHDOperate op = new CHDOperate();

            op.CHDLogMsg += Op_CHDLogMsg;
            if (op.ConnectionDevice(com, DeviceType.CHDCardReader, portOrBaud: 9600, isTcp: false))
            {
                string no = "";
                if (null != op && !string.IsNullOrWhiteSpace(com))
                {
                    no = op.GetCardNum();
                }
                op.DisConnectionDevice();
                return(no);
            }
            TextMsg?.Invoke(string.Format("门禁主机 {0} 获取卡号失败···", com, DateTime.Now));
            return("");
        }