Esempio n. 1
0
        /// <summary>
        /// 检查卡信息
        /// </summary>
        /// <returns></returns>
        public bool CheckCard()
        {
            try
            {
                int  st;
                byte rlen = 0;

                if (icDev == 0)
                {
                    return(false);
                }

                char[] ssnr  = new char[128];
                byte[] rbuff = new byte[128];

                st = DCRFHeader.dc_card_double_hex(icDev, 0, ssnr);
                if (st != 0)
                {
                    this.SendErrorInfo("寻卡失败,请将卡片移走重新放入读卡区重试!");
                    DCRFHeader.dc_exit(icDev);
                    return(false);
                }

                SendReportInfo(DataConvert.ArrayToStirng(ssnr));


                st = DCRFHeader.dc_pro_reset(icDev, ref rlen, rbuff);
                if (st != 0)
                {
                    this.SendErrorInfo("寻卡失败,请将卡片移走重新放入读卡区重试!");
                    DCRFHeader.dc_exit(icDev);
                    return(false);
                }


                SendReportInfo("寻卡成功!");

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }