Beispiel #1
0
        private void CaptureDataFingerpint(int message)
        {
            switch (message)
            {
            case MESSAGE_CAPTURED_OK:
            {
                MemoryStream ms = new MemoryStream();
                BitmapFormat.GetBitmap(FPBuffer, mfpWidth, mfpHeight, ref ms);
                Bitmap bmp = new Bitmap(ms);

                // this is for testing, to check whether it receives a proper Bitmap data.
                //bmp.Save("test.bmp", ImageFormat.Png);

                String strShow = zkfp2.BlobToBase64(CapTmp, cbCapTmp);

                String current_dt = tk.GetCurrentDatetime();
                Console.WriteLine("----------------------");
                Console.WriteLine(current_dt);
                Console.WriteLine("----------------------");
                Console.WriteLine("captured data : " + strShow + "\n");

                Keyboard.AutoCopyPasteEvent(strShow);
            }
            break;

            default:
                Console.WriteLine("Error : Invalid Data Fingerprint.");
                break;
            }
        }
Beispiel #2
0
        public void Inventory()
        {
            int i;
            int CardNum = 0;
            int Totallen = 0;
            int EPClen, m;

            byte[] EPC = new byte[5000];
            int    CardIndex;
            string temps;
            string s, sEPC;
            bool   isonlistview;

            fIsInventoryScan = true;
            byte AdrTID  = 0;
            byte LenTID  = 0;
            byte TIDFlag = 0;

            fCmdRet = StaticClassReaderB.Inventory_G2(ref fComAdr, AdrTID, LenTID, TIDFlag, EPC, ref Totallen, ref CardNum, frmcomportindex);
            if ((fCmdRet == 1) | (fCmdRet == 2) | (fCmdRet == 3) | (fCmdRet == 4) | (fCmdRet == 0xFB))
            {
                byte[] daw = new byte[Totallen];
                //Console.WriteLine(daw);
                Array.Copy(EPC, daw, Totallen);
                temps = ByteArrayToHexString(daw);
                fInventory_EPC_List = temps;
                m = 0;
                //Console.WriteLine("Card Num : " + CardNum);
                if (CardNum == 0)
                {
                    fIsInventoryScan = false;
                    return;
                }
                else
                {
                    EPClen = daw[m];
                    sEPC   = temps.Substring(m * 2 + 2, EPClen * 2);

                    // Show UID Card
                    string EPC_Card = tk.ConvertEPCHexToNumber(sEPC);
                    Console.WriteLine("\n=========================");
                    Console.WriteLine(tk.GetCurrentDatetime());
                    Console.WriteLine("=========================");
                    Console.WriteLine("UID : " + EPC_Card);

                    // auto copy-paste feature
                    keyboard.AutoCopyPasteEvent(EPC_Card);
                }
            }
            fIsInventoryScan = false;
        }