private void handleImage(Bitmap fingerprintimage) { _stopWatch.Restart(); pictureBox1.Image = fingerprintimage; // remove&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& TypeAskID request = new TypeAskID(); request.base64FingerprintTemplate = Convert.ToBase64String(Conversion.fingerprintImageToFingerprintTemplate(fingerprintimage)); TypeReturnID awnser = SqlAndWeb.httpPostWithErrorCheckAndPassword <TypeReturnID>(request, _webAddress, _wachtwoord); _stopWatch.Stop(); _processTime = _stopWatch.ElapsedMilliseconds.ToString(); if (awnser.ID != 0) { label2.Text = "ID: " + awnser.ID.ToString(); label3.Text = "voornaam: " + awnser.voorNaam; label4.Text = "achternaam: " + awnser.achterNaam; label5.Text = "ImageTransferTime=" + _imageTransferTime; label6.Text = "ProcessTime=" + _processTime; label7.Text = "Total=" + (Convert.ToInt32(_imageTransferTime) + Convert.ToInt32(_processTime)); //pictureBox1.Image = ServerFunctions.SFuncs.getImageFromBase64String(awnser.base64ProfileImage); &&&&&&&&&&&&&&&&& showExtaInfo(awnser); } else { label2.Text = "ID: unknown"; label3.Text = "voornaam: kanNietVinden"; label4.Text = "achternaam: kanNietVinden"; label5.Text = "ImageTransferTime=" + _imageTransferTime; label6.Text = "ProcessTime=" + _processTime; label7.Text = "Total=" + (Convert.ToInt32(_imageTransferTime) + Convert.ToInt32(_processTime)); //pictureBox1.Image = null; } _timerCleanUI.Start(); }
//Ok 12-400 /// <summary> /// wie is het /// </summary> /// <param name="_inObject"></param> /// <returns></returns> public static string wieIsDit(object _inObject) { try { string wertkWel = JsonConvert.SerializeObject(_inObject); TypeAskID IDRequest = JsonConvert.DeserializeObject <TypeAskID>(wertkWel); SqlCommand command = new SqlCommand(); command.CommandText = "SELECT id,fingerprintTemplate FROM " + settings.studentBDTableName; DataTable queryResult = SqlAndWeb.SQLQuery(settings.connectionString, command); List <Person> personList = new List <Person>(); foreach (DataRow row in queryResult.Rows) { Person person = new Person(); Fingerprint fingerprint = new Fingerprint(); person.Id = (int)row["id"]; string base64FingerTemplate = (string)row["fingerprintTemplate"]; fingerprint.Template = Convert.FromBase64String(base64FingerTemplate); person.Fingerprints.Add(fingerprint); personList.Add(person); } Person unknowPerson = new Person(); Fingerprint unknowFingerprint = new Fingerprint(); unknowFingerprint.Template = Convert.FromBase64String(IDRequest.base64FingerprintTemplate); unknowPerson.Fingerprints.Add(unknowFingerprint); Person wieHetIs = afis.Identify(unknowPerson, personList).FirstOrDefault(); if (wieHetIs != null) { SqlCommand comond = new SqlCommand(); comond.CommandText = "select ID,voorNaam,achterNaam,profileImage from " + settings.studentBDTableName + " where ID=" + wieHetIs.Id; DataTable queryResponse = SqlAndWeb.SQLQuery(settings.connectionString, comond); DataRow theRow = queryResponse.Rows[0]; TypeReturnID returnType = new TypeReturnID(); returnType.ID = (int)theRow["id"]; returnType.voorNaam = (string)theRow["voorNaam"]; returnType.achterNaam = (string)theRow["achterNaam"]; returnType.base64ProfileImage = (string)theRow["profileImage"]; return(JsonConvert.SerializeObject(returnType)); } else { return(JsonConvert.SerializeObject(new TypeReturnID())); } } catch (Exception ex) { TypeReturnError typeForError = new TypeReturnError(); typeForError.why = "(wieIsDit)" + ex.Message; return(JsonConvert.SerializeObject(typeForError)); } }