Exemplo n.º 1
0
        private void frmChamada_Load(object sender, EventArgs e)
        {
            ver = new FlexCodeSDK.FinFPVer();
            ver.FPVerificationID     += new __FinFPVer_FPVerificationIDEventHandler(ver_FPVerificationID);
            ver.FPVerificationStatus += new __FinFPVer_FPVerificationStatusEventHandler(ver_FPVerificationStatus);
            ver.AddDeviceInfo("44099166", "5136C24F5BF8CFA", "LDU428676B59828C60678JSD");

            try
            {
                conexao = new MySqlConnection(Endereco());
                conexao.Open();
                string          chamada  = "SELECT cod, digital FROM presenca";
                MySqlCommand    comandos = new MySqlCommand(chamada, conexao);
                MySqlDataReader rdr      = comandos.ExecuteReader();
                if (rdr.HasRows)
                {
                    while (rdr.Read())
                    {
                        ver.FPLoad(rdr.GetString(0), 0, rdr.GetString(1), "MySecretKey" + rdr.GetString(0));
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Erro de comandos: " + ex.Message);
            }


            conexao.Close();
            ver.WorkingInBackground(false);
            ver.FPVerificationStart();
        }
Exemplo n.º 2
0
        private void frmFingerPrintLogin_Load(object sender, EventArgs e)
        {
            log.Debug("IN");

            try
            {
                //Initialize FlexCodeSDK for Verification
                //1. Initialize Event Handler
                ver = new FlexCodeSDK.FinFPVer();
                ver.FPVerificationID     += new __FinFPVer_FPVerificationIDEventHandler(ver_FPVerificationID);
                ver.FPVerificationStatus += new __FinFPVer_FPVerificationStatusEventHandler(ver_FPVerificationStatus);

                //2. Input the activation code
                ver.AddDeviceInfo("HY20E20453", "996E93F0285F7D1", "2M13A7D9A0CF41DB625AB1ED");

                //4. Load templates from database to FlexCodeSDK
                string sql = "SELECT userIdentity, userFingerprint FROM TimePunchUserIdentities where userFingerprint <>'' ";

                // Make a connection to the database if it hasnt already
                connectToDatabase();

                SQLiteCommand    command1 = new SQLiteCommand(sql, m_dbConnection);
                SQLiteDataReader reader1  = command1.ExecuteReader();

                while (reader1.Read())
                {
                    ver.FPLoad(reader1.GetString(0), 0, reader1.GetString(1), "MySecretKey" + reader1.GetString(0));
                }
                reader1.Close();

                //5. Start verification process
                ver.FPVerificationStart();
            }
            catch (Exception ex)
            {
                log.Error("Error", ex);
                MessageBox.Show(ex.Message, "Error - " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }