Ejemplo n.º 1
0
        private void TestFinger(uint deviceID, String userID)
        {
            string[] userIDs = new string[1];
            userIDs[0] = userID;

            var users = userSvc.GetUser(deviceID, userIDs);

            Console.WriteLine("User without fingerprint: {0}" + Environment.NewLine, users[0]);

            var userFingers = new User.UserFinger[1];

            userFingers[0] = new User.UserFinger {
                UserID = userID
            };

            Console.WriteLine(">>> Scan a finger for {0}", userID);
            var firstTemplate = fingerSvc.Scan(deviceID, Finger.TemplateFormat.Suprema, QUALITY_THRESHOLD);

            Console.WriteLine(">>> Scan the same finger for {0}", userID);
            var secondTemplate = fingerSvc.Scan(deviceID, Finger.TemplateFormat.Suprema, QUALITY_THRESHOLD);

            var fingerData = new Finger.FingerData {
                Index = 0, Flag = 0
            };

            fingerData.Templates.Add(firstTemplate);
            fingerData.Templates.Add(secondTemplate);

            userFingers[0].Fingers.Add(fingerData);

            userSvc.SetFinger(deviceID, userFingers);

            users = userSvc.GetUser(deviceID, userIDs);
            Console.WriteLine("User after adding fingerprints: {0}" + Environment.NewLine, users[0]);
        }
Ejemplo n.º 2
0
        public void Test(uint deviceID)
        {
            Console.WriteLine(">>> Scan a finger...");

            var templateData = fingerSvc.Scan(deviceID, Finger.TemplateFormat.Suprema, QUALITY_THRESHOLD);

            Console.WriteLine("Finger template: {0}" + Environment.NewLine, BitConverter.ToString(templateData.ToByteArray()));

            var bmpImage = fingerSvc.GetImage(deviceID);

            File.WriteAllBytes(FINGERPRINT_IMAGE_FILE, bmpImage.ToByteArray());

            var fingerConfig = fingerSvc.GetConfig(deviceID);

            Console.WriteLine("Finger config: {0}" + Environment.NewLine, fingerConfig);
        }