Example #1
0
 private void savefingerprint()
 {
     try
     {
         Dictionary <int, string>         Fmds = new Dictionary <int, string>();
         Dictionary <int, List <string> > Fids = new Dictionary <int, List <string> >();
         foreach (int finger in mobj.Fmds.Keys)
         {
             Fmds.Add(finger, Fmd.SerializeXml(mobj.Fmds[finger]));
             //MessageBox.Show("extracted fmd :" + Fmd.SerializeXml(mobj.Fmds[finger]), "Alert");
             List <string> fds = new List <string>();
             foreach (Fid fd in mobj.Fids[finger])
             {
                 fds.Add(Fid.SerializeXml(fd));
                 //   MessageBox.Show("extracted fid :"+Fid.SerializeXml(fd), "Alert");
             }
             Fids.Add(finger, fds);
         }
         PersonRepository repo = new PersonRepository();
         bool             b    = repo.saveFingerPrint(Fmds, Fids, pvm.PersonId, null);
         if (b)
         {
             bio_altered = false; MessageBox.Show("FingerPrint Saved Successully", "Alert", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         else
         {
             MessageBox.Show("Error Saving FingerPrint. ", "Alert");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error Saving FingerPrint. Details:" + ex.StackTrace, "Alert");
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlConnection con = null;

            try
            {
                String ConString = ConfigurationManager.ConnectionStrings["biometrics.Properties.Settings.testreportConnectionString"].ConnectionString;
                con = new MySqlConnection(ConString);
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                con.Open();
                MySqlCommand cmd = con.CreateCommand();
                cmd.CommandText = "Insert into tblfinger (LedgerId, CustomerFinger) VALUES (@ledger, @fingerPrint)";
                cmd.Parameters.AddWithValue("@ledger", ledgerid.Text.ToString());
                cmd.Parameters.AddWithValue("@fingerPrint", Fmd.SerializeXml(firstFinger));
                cmd.ExecuteNonQuery();
                MessageBox.Show("Record Created Successfully");
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Fail To Create User");
                con.Close();
            }
        }
        private void EnrollThread()
        {
            objVariables.count = 0;

            objPrincipal.txtSalida.Dispatcher.BeginInvoke(new Action(delegate()
            {
                objPrincipal.txtSalida.AppendText("Se inicio el registro de huellas. \nColocar el dedo en el lector.");
            }));

            while (!objVariables.reset)
            {
                DataResult <Fmd> resultEnrollment = DPUruNet.Enrollment.CreateEnrollmentFmd(Constants.Formats.Fmd.ANSI, CaptureAndExtractFmd());

                if (resultEnrollment.ResultCode == Constants.ResultCode.DP_SUCCESS)
                {
                    MessageBox.Show("El registro de huella fue exitoso.",
                                    "Aviso",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information,
                                    MessageBoxDefaultButton.Button1);

                    objVariables.serializacion = Fmd.SerializeXml(resultEnrollment.Data);
                    objVariables.count         = 0;
                    objVariables.reset         = true;

                    objPrincipal.EndEnrollment(objVariables.serializacion, true);
                }
            }

            if (objVariables.currentReader != null)
            {
                objVariables.currentReader.Dispose();
            }
        }
Example #4
0
 private void enrollment_OnEnroll(EnrollmentControl enrollmentControl, DataResult <Fmd> enrollmentResult, int fingerPosition)
 {
     if (enrollmentResult != null && enrollmentResult.Data != null)
     {
         Fmd    datos  = enrollmentResult.Data;
         string cadena = Fmd.SerializeXml(datos);
         enviar(cadena);
         this.Close();
     }
 }
        public void OnCaptured(CaptureResult captureResult)
        {
            this.picBoxToCap     = picBoxFingerPrint;
            this.fingerToCapture = 0;
            count++;
            lblCount.Invoke(new Action(() => { lblCount.Text = count.ToString(); }));
            DataResult <Fmd> resultConversion = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Constants.Formats.Fmd.ANSI);

            if (captureResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
            {
                if (CurrentReader != null)
                {
                    CurrentReader.Dispose();
                    CurrentReader = null;
                }

                MessageBox.Show("Error:  " + captureResult.ResultCode);
            }
            if (captureResult.Data != null)
            {
                foreach (Fid.Fiv fiv in captureResult.Data.Views)
                {
                    picBoxFingerPrint.Image    = CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height);
                    picBoxFingerPrint.SizeMode = PictureBoxSizeMode.Zoom;
                }
            }
            preenrollmentFmds.Add(resultConversion.Data);
            if (count >= 4)
            {
                resultEnrollment = Enrollment.CreateEnrollmentFmd(Constants.Formats.Fmd.ANSI, preenrollmentFmds);

                TempFingerPrint = Fmd.SerializeXml(resultConversion.Data);

                resultEnrollment = DPUruNet.Enrollment.CreateEnrollmentFmd(Constants.Formats.Fmd.ANSI, preenrollmentFmds);

                if (resultEnrollment.ResultCode == Constants.ResultCode.DP_SUCCESS)
                {
                    FileStream fs = new System.IO.FileStream(@"..\..\Pictures\right.bmp", FileMode.Open, FileAccess.Read);
                    picRigithWrong.Invoke(new Action(() => { picRigithWrong.Image = Image.FromStream(fs); }));
                    picRigithWrong.SizeMode = PictureBoxSizeMode.Zoom;
                    //preenrollmentFmds.Clear();
                    //count = 0;
                    MessageBox.Show("An enrollment was successfully created.");
                    return;
                }
                else if (resultEnrollment.ResultCode == Constants.ResultCode.DP_ENROLLMENT_INVALID_SET)
                {
                    MessageBox.Show("Enrollment was unsuccessful.  Please try again.");
                    preenrollmentFmds.Clear();
                    count = 0;
                    return;
                }
            }
        }
        private void Enrollpage_On_Enroll(DPCtlXUru.EnrollmentXControl enrollmentControl, XFmdResult result, int fingerPosition)
        {
            // Helper.Fmds.Add(fingerPosition, result.Fmd.Fmd);//Helper.Source.Add(result.Fmd.Fmd.Bytes);
            var fmdxml = Fmd.SerializeXml(result.Fmd.Fmd);
            var main   = ResourcesBase.GetMainWindowViewModel();

            Pegawai.Enrollment = fmdxml;
            var res = main.PegawaiCollection.Updated(Pegawai);

            SendMessage(ActionMessage.SendMessage, "Enroll Complete");
        }
Example #7
0
        /// <summary>
        /// The on capture.
        /// </summary>
        /// <param name="captureResult">
        /// The capture result.
        /// </param>
        private void OnCapture(CaptureResult captureResult)
        {
            var resultFingerprint = new ResultFingerprint {
                Result = this.CheckCaptureResult(captureResult)
            };

            resultFingerprint.Message                 = !resultFingerprint.Result ? es_CO.BadCapture : es_CO.Captured;
            resultFingerprint.ImageFingerprints       = !resultFingerprint.Result ? null : FingerprintSerializer.GetFingerprintBitmap(captureResult.Data.Views);
            resultFingerprint.StringImageFingerprints = !resultFingerprint.Result ? null : FingerprintSerializer.GetFingerprintStringBitmap(captureResult.Data.Views);
            resultFingerprint.XmlFmd = !resultFingerprint.Result ? string.Empty : Fmd.SerializeXml(FeatureExtraction.CreateFmdFromFid(captureResult.Data, Constants.Formats.Fmd.ANSI).Data);
            resultFingerprint.FileFingerprintImage = !resultFingerprint.Result ? string.Empty : FingerprintSerializer.GetFingerprintFile(captureResult.Data.Views);

            this.CaptureProcessed?.Invoke(resultFingerprint);
        }
 /// <summary>
 /// ClearFingerprintsbyID - finds and clears the list of FMD data for a given ID
 ///           - returns false if not found
 /// </summary>
 /// <param name="lc"></param>
 /// <returns></returns>
 public bool AddFingerprintbyID(string id, Fmd data)
 {
     foreach (BiometricData bd in biometricDataList)
     {
         if (bd.ID == id)
         {
             bd.FIDList.Add(Fmd.SerializeXml(data));
             bd.FMDs.Add(data);
             return(true);
         }
     }
     AddBiometricData(new BiometricData(id, data));
     return(false);
 }
Example #9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var computerNo = tbName.Text.Trim();

            if (computerNo.Length == 0)
            {
                MessageBox.Show("Please enter Computer Number");
                return;
            }

            string xmlFMD1 = Fmd.SerializeXml(fmd1);

            string saveFmdScript = "UPDATE Prisoners SET FMD1='" + xmlFMD1 + "' WHERE PrisonerId = (SELECT PrisonerId FROM Admissions WHERE AdmissionId = " + computerNo + ")";

            // Save user and his relative FMD into database
            int count = HelperFunctions.ConnectDBnExecuteScript(saveFmdScript);

            if (count == 1)
            {
                PostFingerprintImage(pb3.Image, computerNo);
                MessageBox.Show("Successfully enrolled fingerprint of Computer Number : " + computerNo);
                Reset();
            }
            else
            {
                MessageBox.Show("Computer Number " + computerNo + " NOT found!");
            }

            //if (leftIndex == null || rightIndex == null) { MessageBox.Show("Fingerprint enrollment incomplete."); return; }
            //try
            //{
            //    identification.AddUser(new User(tbName.Text, leftIndex, rightIndex));
            //}
            //catch (ArgumentException ex)
            //{
            //    MessageBox.Show("User ID already taken.  Please enter a different ID.");
            //    return;
            //}
            //this.DialogResult = System.Windows.Forms.DialogResult.OK;
            //reader.Dispose();
            //this.Close();
            //return;
        }
Example #10
0
        private void RegButton_Click(object sender, EventArgs e)
        {
            if (ValidateControls())
            {
                basicAuthDone = true;
                UseWaitCursor = true;
                Cursor        = Cursors.WaitCursor;

                if (basicAuthDone && fingerprintRegDone && faceCaptureDone)
                {
                    var userSaved = false;
                    try
                    {
                        CreatorData.User = UserRepository.CreateUser(new User
                        {
                            Name               = NameTextBox.Text,
                            Address            = AddressTextBox.Text,
                            Phone              = PhoneTextBox.Text,
                            Email              = EmailTextBox.Text,
                            ZipOrPostalAddress = ZipOrPostalCodeTextBox.Text,
                            HashSalt           = Guid.NewGuid().ToString()
                        });

                        CreatorData.User.PasswordHash = BitConverter.ToString(SHA512.Create().ComputeHash(Encoding.UTF8.GetBytes(PasswordTextBox.Text + CreatorData.User.HashSalt)));
                        userSaved = true;
                    }
                    catch (Exception ex)
                    {
                        string addMessage(string message, Exception exception)
                        {
                            if (message == null)
                            {
                                message = string.Format("{0}\n", ex.Message);
                            }
                            else
                            {
                                message = string.Format("{0}\nCaused by {1}\n", message, ex.Message);
                            }

                            if (ex.InnerException != null)
                            {
                                return(addMessage(message, ex.InnerException));
                            }
                            else
                            {
                                return(message);
                            }
                        }

                        MessageBox.Show(addMessage(null, ex), "Error");
                    }

                    var fingerprintSaved = false;
                    if (userSaved)
                    {
                        try
                        {
                            var Fmds = new Dictionary <int, string>();
                            var Fids = new Dictionary <int, List <string> >();
                            foreach (var finger in CreatorData.FingerprintData.MainObject.Fmds.Keys)
                            {
                                Fmds.Add(finger, Fmd.SerializeXml(CreatorData.FingerprintData.MainObject.Fmds[finger]));
                                //MessageBox.Show("extracted fmd :" + Fmd.SerializeXml(CreatorData.FingerprintData.MainObject.Fmds[finger]), "Alert");
                                var fids = new List <string>();
                                foreach (var fid in CreatorData.FingerprintData.MainObject.Fids[finger])
                                {
                                    fids.Add(Fid.SerializeXml(fid));
                                    //   MessageBox.Show("extracted fid :"+Fid.SerializeXml(fd), "Alert");
                                }
                                Fids.Add(finger, fids);
                            }
                            var b = UserRepository.SaveFingerPrint(Fmds, Fids, CreatorData.User.Email, null);
                            if (b)
                            {
                                fingerprintSaved = true;
                                CreatorData.FingerprintData.MainObject.Fids.Clear();
                                CreatorData.FingerprintData.MainObject.Fmds.Clear();
                            }
                            else
                            {
                                MessageBox.Show("Error Saving FingerPrint. ", "Alert");
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Error Saving FingerPrint. Details:" + ex.StackTrace, "Alert");
                        }

                        if (fingerprintSaved)
                        {
                            // Registration complete, display form to enter required input data
                            var financialDataForm = new FinancialDataForm(CreatorData.User, FinancialDataFormMode.edit);
                            financialDataForm.ShowDialog();
                            UseWaitCursor = false;
                            CreatorData.Reciever.LoadTask("QuestionAndAnswer");
                        }
                        else
                        {
                            Console.Beep();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error Saving User. ", "Alert");
                        Console.Beep();
                    }
                }
            }
            else
            {
                Console.Beep();
            }
        }
Example #11
0
        private void OnCaptured(CaptureResult result)
        {
            frmEncontrarDispositivo n = new frmEncontrarDispositivo();
            //if (n.conectado==false)
            //{
            //    DialogResult dialogoerror = globales.MessageBoxError("Ocurrio un error, no se detecta dispositivo", "Verificar", globales.menuPrincipal);
            //    return;
            //    dispo.Text = "DISPOSITIVO NO CONECTADO";
            //}

            DataResult <Fmd> resultConversion = FeatureExtraction.CreateFmdFromFid(result.Data, Constants.Formats.Fmd.ANSI);

            if (result.ResultCode != Constants.ResultCode.DP_SUCCESS)
            {
                //throw new Exception(result.ResultCode.ToString());
            }


            Fmd capturado = resultConversion.Data;

            try
            {
                string hexa = ByteArrayToString(capturado.Bytes);
            }
            catch
            {
                CheckForIllegalCrossThreadCalls = false;
                dispo.Text = "DISPOSITIVO NO CONECTADO";
                return;
            }

            //    string query = $"select jpp,num,huella from nominas_catalogos.maestro where huella is not null order by jpp,num";
            string query = "select jpp,num,huella from nominas_catalogos.maestro where huella is not null  and huella <>'' order by jpp,num";
            List <Dictionary <string, object> > resultado = globales.consulta(query);

            if (resultado.Count <= 0)
            {
                return;
            }


            string caaaa = Fmd.SerializeXml(capturado);
            Fmd    dese  = Fmd.DeserializeXml(caaaa);

            bool encontrado = true;

            foreach (Dictionary <string, object> item in resultado)
            {
                string      xmlStr = Convert.ToString(item["huella"]);
                XmlDocument xml    = new XmlDocument();
                xml.LoadXml(xmlStr);
                Fmd   fmd  = Fmd.DeserializeXml(xmlStr);
                Fmd[] fmds = new Fmd[1];
                fmds[0] = fmd;
                // fmds[1] = capturado;


                int thresholdScore = DPFJ_PROBABILITY_ONE * 1 / 100000;

                CompareResult  resultadoAux   = Comparison.Compare(capturado, 0, fmd, 0);
                IdentifyResult identifyResult = Comparison.Identify(capturado, 0, fmds, thresholdScore, 2);

                if (resultadoAux.Score == 0)
                {
                    realizarMensaje(tipo_mensaje.success, $"{item["jpp"]} encontrado");


                    query     = $"select * from nominas_catalogos.maestro where huella is not null and jpp = '{item["jpp"]}' and num = {item["num"]} order by jpp,num";
                    resultado = globales.consulta(query);
                    if (resultado.Count != 0)
                    {
                        huellita = true;
                        rellenar(resultado[0]);
                    }
                    encontrado = true;
                    break;
                }
                else
                {
                    encontrado = false;
                }

                if (resultadoAux.ResultCode != Constants.ResultCode.DP_SUCCESS)
                {
                    realizarMensaje(tipo_mensaje.exclamation, "UPS, NO SE ENCUENTRA LA HUELLA EN LA BASE");
                    encontrado = true;
                    return;
                }
            }

            if (!encontrado)
            {
                realizarMensaje(tipo_mensaje.exclamation, "UPS, NO SE ENCUENTRA LA HUELLA EN LA BASE");
            }
        }
 internal BiometricData(string id, Fmd initialdata)
 {
     ID = id; FMDs = new List <Fmd>(); FIDList = new List <string>(); FMDs.Add(initialdata); FIDList.Add(Fmd.SerializeXml(initialdata));
 }
Example #13
0
        /// <summary>
        /// Handler for when a fingerprint is captured.
        /// </summary>
        /// <param name="captureResult">contains info and data on the fingerprint capture</param>
        private void OnCaptured(CaptureResult captureResult)
        {
            try
            {
                // Check capture quality and throw an error if bad.
                if (!_sender.CheckCaptureResult(captureResult))
                {
                    return;
                }

                count++;

                DataResult <Fmd> resultConversion = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Constants.Formats.Fmd.ANSI);

                if (count > 0)
                {
                    Fid.Fiv fiv = captureResult.Data.Views[0];
                    SendMessage(Action.SendBitmap, CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height));
                }

                SendMessage(Action.SendMessage, "A Reading was captured.  \r\nCount:  " + (count));

                if (resultConversion.ResultCode != Constants.ResultCode.DP_SUCCESS)
                {
                    _sender.Reset = true;
                    throw new Exception(resultConversion.ResultCode.ToString());
                }

                preenrollmentFmds.Add(resultConversion.Data);

                if (count >= 4)
                {
                    DataResult <Fmd> resultEnrollment = DPUruNet.Enrollment.CreateEnrollmentFmd(Constants.Formats.Fmd.ANSI, preenrollmentFmds);

                    if (resultEnrollment.ResultCode == Constants.ResultCode.DP_SUCCESS)
                    {
                        SendMessage(Action.SendMessage, "An enrollment FMD was successfully created.");
                        SendMessage(Action.SendMessage, "Place Right Thumb on the device.");
                        preenrollmentFmds.Clear();
                        count = 0;

                        this.rightThumb = Fmd.SerializeXml(resultConversion.Data);

                        return;
                    }
                    else if (resultEnrollment.ResultCode == Constants.ResultCode.DP_ENROLLMENT_INVALID_SET)
                    {
                        SendMessage(Action.SendMessage, "Enrollment was unsuccessful.  Please try again.");
                        SendMessage(Action.SendMessage, "Place Right Thumb on the device.");
                        preenrollmentFmds.Clear();
                        count = 0;
                        return;
                    }
                }

                SendMessage(Action.SendMessage, "Now place the same finger on the device.");
            }
            catch (Exception ex)
            {
                // Send error message, then close form
                SendMessage(Action.SendMessage, "Error:  " + ex.Message);
            }
        }
Example #14
0
        private void buttonLabel1_Click(object sender, EventArgs e)
        {
            Account account = CreateAccount();

            JObject obj = new JObject();

            obj.Add("FirstName", txtFirstName.Text);
            obj.Add("LastName", txtLastName.Text);
            obj.Add("MiddleName", txtMiddleName.Text);

            JsonConvert.SerializeObject(obj);


            BlockchainHelper.CreateTransaction(account, JsonConvert.SerializeObject(obj));
            //TransferTransactionFromCreatedAccount(account.PrivateKey, account.Address.Plain, "ok");

            foreach (var entry in Fmds)
            {
                Fingerprint fp = new Fingerprint();
                fp.Index = entry.Key;
                String tempFingerPrint = Fmd.SerializeXml(entry.Value);
                //fp.FingerprintData = BitConverter.ToString(entry.Value.Bytes).Replace("-", "");
                fp.FingerprintData = tempFingerPrint;
                fp.Address         = account.Address.Plain;
                //fp.Save();
            }

            Record record = new Record();

            //record.Address = account.Address.Plain; // blockchain account address

            //record.LastName = txtLastName.Text;
            //record.FirstName = txtFirstName.Text;
            //record.MiddleName = txtMiddleName.Text;
            //record.Suffix = txtSuffix.Text;

            //record.MaidenName = txtMaidenName.Text;
            //record.Gender = cmbGender.SelectedValue.ToString()[0];
            //record.DateOfBirth = pckDateOfBirth.Value.ToString("yyyy-MM-dd");
            //record.PlaceOfBirth = txtPlaceOfBirth.Text;

            //record.SSS = txtSSS.Text;
            //record.TIN = txtTIN.Text;
            //record.PhilHealth = txtPhilHealth.Text;
            //record.Passport = txtPassport.Text;

            //record.BloodType = int.Parse(cmbBloodType.SelectedItem.Value.ToString());
            //record.MaritalStatus = cmbMaritalStatus.SelectedValue.ToString()[0];
            //record.Religion = txtReligion.Text;
            //record.Nationality = txtNationality.Text;

            //record.MobileNo = txtMobile.Text;
            //record.LandlineNo = txtPhone.Text;
            //record.Email = txtEmailAddress.Text;

            //record.DocumentPresented = cmbDocumentPresented.SelectedValue.ToString();
            //record.Save();


            MessageBox.Show("Saved");
        }
Example #15
0
        /// <summary>
        /// Open the reader and capture two fingers to compare.
        /// </summary>
        private void VerifyThread()
        {
            var result = Constants.ResultCode.DP_DEVICE_FAILURE;

            result = Currentinstance.CurrentReader.Open(Constants.CapturePriority.DP_PRIORITY_COOPERATIVE);
            if (result != Constants.ResultCode.DP_SUCCESS)
            {
                MessageBox.Show("Error:  " + result);
                if (Currentinstance.CurrentReader != null)
                {
                    Currentinstance.CurrentReader.Dispose();
                    Currentinstance.CurrentReader = null;
                }
                return;
            }

            Fmd fmd1 = null;

            //  Fmd fmd2 = null;

            SendMessage("Place a finger on the reader.");
            while (!reset)
            {
                Fid fid = null;

                if (!Currentinstance.CaptureFinger(ref fid))
                {
                    break;
                }

                if (fid == null)
                {
                    continue;
                }

                SendMessage("A finger was captured.");

                var resultConversion = FeatureExtraction.CreateFmdFromFid(fid, Constants.Formats.Fmd.ANSI);

                if (resultConversion.ResultCode != Constants.ResultCode.DP_SUCCESS)
                {
                    break;
                }

                /* if (count == 0)
                 * {
                 *   fmd1 = resultConversion.Data;
                 *   count += 1;
                 *   SendMessage("Now place the same or a different finger on the reader.");
                 * }
                 * else if (count == 1)
                 * {
                 *   fmd2 = resultConversion.Data;
                 *   CompareResult compareResult = Comparison.Compare(fmd1, 0, fmd2, 0);
                 *
                 *   if (compareResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
                 *   {
                 *       break;
                 *   }
                 *
                 *   SendMessage("Comparison resulted in a dissimilarity score of " + compareResult.Score.ToString() + (compareResult.Score < (PROBABILITY_ONE/100000) ? " (fingerprints matched)" : " (fingerprints did not match)"));
                 *   SendMessage("Place a finger on the reader.");
                 *   count = 0;
                 * }*/

                fmd1 = resultConversion.Data;
                var pass_threshold = false;
                foreach (var fd in database)
                {
                    var compareResult = Comparison.Compare(fmd1, 0, fd, 0);
                    if (compareResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
                    {
                        break;
                    }
                    pass_threshold = compareResult.Score < (PROBABILITY_ONE / 100000);
                    SendMessage("Comparison resulted in a dissimilarity score of " + compareResult.Score.ToString() + (pass_threshold ? " (fingerprints matched)" : " (fingerprints did not match)"));
                    //SendMessage("Place a finger on the reader.");
                    if (pass_threshold)
                    {
                        break;
                    }
                }

                if (Currentinstance.CurrentReader != null)
                {
                    Currentinstance.CurrentReader.Dispose();
                    Currentinstance.CurrentReader = null;
                }

                FormClosed += (o, e) =>
                {
                    if (pass_threshold)
                    {
                        SuccessReading = Fmd.SerializeXml(fmd1);
                    }

                    OnComplete(pass_threshold);
                };

                verifyThreadHandle.Abort();
            }

            if (Currentinstance.CurrentReader != null)
            {
                Currentinstance.CurrentReader.Dispose();
                Currentinstance.CurrentReader = null;
            }
        }
 public String SerializeData(Fmd data)
 {
     return(Fmd.SerializeXml(data));
 }