Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Inicializar o FlexCode SDK
            reg = new FinFPReg();
            reg.FPSamplesNeeded        += new __FinFPReg_FPSamplesNeededEventHandler(reg_FPSamplesNeeded);
            reg.FPRegistrationTemplate += new __FinFPReg_FPRegistrationTemplateEventHandler(reg_FPRegistrationTemplate);
            reg.FPRegistrationImage    += new __FinFPReg_FPRegistrationImageEventHandler(reg_FPRegistrationImage);
            reg.FPRegistrationStatus   += new __FinFPReg_FPRegistrationStatusEventHandler(reg_FPRegistrationStatus);

            //Codigo de ativação do FlexCode SDK
            reg.AddDeviceInfo("", "", "");
        }
Пример #2
0
        private void frmBio_Load(object sender, EventArgs e)
        {
            reg = new FlexCodeSDK.FinFPReg();
            reg.FPSamplesNeeded        += new __FinFPReg_FPSamplesNeededEventHandler(reg_FPSamplesNeeded);
            reg.FPRegistrationTemplate += new __FinFPReg_FPRegistrationTemplateEventHandler(reg_FPRegistrationTemplate);
            reg.FPRegistrationImage    += new __FinFPReg_FPRegistrationImageEventHandler(reg_FPRegistrationImage);
            reg.FPRegistrationStatus   += new __FinFPReg_FPRegistrationStatusEventHandler(reg_FPRegistrationStatus);

            reg.AddDeviceInfo("44099166", "5136C24F5BF8CFA", "LDU428676B59828C60678JSD");

            reg.PictureSampleHeight = (short)(pictureBox1.Height * 15); //FlexCodeSDK use Twips. 1 pixel = 15 twips
            reg.PictureSampleWidth  = (short)(pictureBox1.Width * 15);  //FlexCodeSDK use Twips. 1 pixel = 15 twips
            imgPath = AppDomain.CurrentDomain.BaseDirectory + "Finger3.bmp";
            reg.PictureSamplePath = imgPath;
        }
Пример #3
0
        private void frmUserInfo_Load(object sender, EventArgs e)
        {
            log.Debug("IN");

            try
            {
                // if this is an update, we need to prefill the form
                if (isUpdate)
                {
                    btnCreateUser.Text = "Update User";
                    txtUserID.Enabled  = false;

                    txtUserID.Text = userIDForForm;

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

                    // check that the user doesnt already exist
                    Boolean foundLogin = false;

                    string sql = "select * from TimePunchUserInfo where userIdentity = '" + userIDForForm + "' order by createUnixTimeStamp desc";

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

                    while (reader1.Read() && !foundLogin)
                    {
                        txtFirstName.Text = reader1["userFirstName"].ToString();
                        txtLastName.Text  = reader1["userLastName"].ToString();
                        txtGrade.Text     = reader1["userGrade"].ToString();

                        foundLogin = true;
                    }
                    reader1.Close();


                    if (!foundLogin)
                    {
                        //do something here if the user we are trying to edit does not exist
                        throw new Exception("User Not Found");
                    }
                    else
                    {
                        // Get the credentials
                        string sqlLogin = "******" + userIDForForm + "' order by createUnixTimeStamp desc";

                        SQLiteCommand    command2 = new SQLiteCommand(sqlLogin, m_dbConnection);
                        SQLiteDataReader reader2  = command2.ExecuteReader();

                        while (reader2.Read())
                        {
                            txtPassword.Text  = reader2["userPassword"].ToString();
                            txtPassword2.Text = txtPassword.Text;
                            //TODOlater - should we add the isAdmin flag at some point.
                            // Meaning, at this point, this form doest support adding an admin or making someone an admin
                        }
                        reader2.Close();
                    }
                }

                lblFingerprintCount.Text = "";

                //Initialize FlexCodeSDK for Registration
                //1. Initialize Event Handler
                reg = new FlexCodeSDK.FinFPReg();
                reg.FPSamplesNeeded        += new __FinFPReg_FPSamplesNeededEventHandler(reg_FPSamplesNeeded);
                reg.FPRegistrationTemplate += new __FinFPReg_FPRegistrationTemplateEventHandler(reg_FPRegistrationTemplate);
                reg.FPRegistrationStatus   += new __FinFPReg_FPRegistrationStatusEventHandler(reg_FPRegistrationStatus);

                //2. Input the activation code
                reg.AddDeviceInfo("HY20E20453", "996E93F0285F7D1", "2M13A7D9A0CF41DB625AB1ED");
            }
            catch (Exception ex)
            {
                log.Error("Error", ex);
                MessageBox.Show(ex.Message, "Error - " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }