Exemplo n.º 1
0
        // Utils
        public static string CardNumToStr(Byte[] aNum, ZR_CARD_TYPE nType)
        {
            string s;

            switch (nType)
            {
            case ZR_CARD_TYPE.ZR_CD_EM:
                s = string.Format("{0},{1:D5}", aNum[3], aNum[1] + (aNum[2] << 8));
                break;

            case ZR_CARD_TYPE.ZR_CD_HID: {
                int nFCnt     = Math.Min(aNum[0] - 2, 4);
                int nFacility = 0;
                int nOffs     = 0;
                for (int i = 0; i < nFCnt; i++, nOffs += 8)
                {
                    nFacility = (aNum[3 + i] << nOffs);
                }
                s = string.Format("[{0}] {1:D5}", nFacility.ToString(string.Format("X{0}", nFCnt * 2)), aNum[1] + (aNum[2] << 8));
            }
            break;

            default: {
                s = "";
                for (int i = aNum[0]; i > 0; i--)
                {
                    s = s + aNum[i].ToString("X2");
                }
            }
            break;
            }
            return(s);
        }
Exemplo n.º 2
0
 public static extern int ZR_Rd_R_A_S(IntPtr hHandle, bool fWakeUp, ref ZR_CARD_TYPE pType,
                                      [In, Out] Byte[] pNum, ref Byte pSAK, ref UInt16 pATQ);
Exemplo n.º 3
0
 public static extern int ZR_Rd_GetEncodedCardNumber(IntPtr hHandle, ref ZR_CARD_TYPE pType, [In, Out] Byte[] pNum,
                                                     [In, Out] Byte[] pBuf, int nBufSize, ref int pRCount);
Exemplo n.º 4
0
 public static extern int ZR_Rd_Request(IntPtr hHandle, bool fWakeUp, ref ZR_CARD_TYPE pType, ref UInt16 pATQ);
Exemplo n.º 5
0
 public static extern int ZR_Rd_FindCard(IntPtr hHandle, ref ZR_CARD_TYPE pType, [In, Out] Byte[] pNum);