private void frmIdentificationServer_Load(object sender, EventArgs e) { BcServerSettings bcServerSettings = BcServerSettings.Load(); this.tbIP.Text = bcServerSettings.Ip; this.tbPort.Text = bcServerSettings.Port.ToString(); this.tbMinus.Text = bcServerSettings.Minus.ToString(); this.chbSaveNewKeys.Checked = bcServerSettings.SaveNewKeys; this.tbThreadCount.Value = (Decimal)bcServerSettings.ThreadCount; this.tbTreckingPeriod.Value = (Decimal)bcServerSettings.TrackingPeriod; this.chbUseErrorCheck.Checked = bcServerSettings.UseErrorCheck; this.chbUseFBDCheck.Checked = bcServerSettings.UseFbdCheck; this.chbUsePBDCheck.Checked = bcServerSettings.UsePbdCheck; this.chbUseOwnScore.Checked = bcServerSettings.UseOwnScore; this.tbHostName.Text = bcServerSettings.HostName; this.tbLogin.Text = bcServerSettings.UserName; this.tbPassword.Text = bcServerSettings.Password; this.tbVirtualHost.Text = bcServerSettings.VirtualHost; this.tbQueueName.Text = bcServerSettings.QueueName; }
private void simpleButton2_Click(object sender, EventArgs e) { if (pictureEdit1.Image == null) { return; } foreach (DataRow dataRow in (InternalDataCollectionBase)_mainTable.Rows) { try { ((System.Drawing.Image)dataRow["Image"]).Dispose(); } catch { } } _mainTable.Rows.Clear(); Image image = ((Bitmap)pictureEdit1.Image).ConvertFrom(); FaceInfo face = MainForm.Engine.DetectMaxFace(image, null); if (face != null) { foreach (BcIdentificationServer identificationServer in BcIdentificationServer.LoadAll()) { try { byte[] template = MainForm.Engine.ExtractTemplate(image, face); BcServerSettings bcServerSettings = BcServerSettings.Load(); IdentificationServerClient identificationServerClient = new IdentificationServerClient(new InstanceContext(_client)); identificationServerClient.Endpoint.Address = new EndpointAddress("net.tcp://" + (object)bcServerSettings.Ip + ":" + (string)(object)bcServerSettings.Port + "/FaceIdentification/IdentificationServer"); identificationServerClient.Open(); List <Guid> list = new List <Guid>(); long dtFrom = 0; if (this.dtFrom.Text != "") { dtFrom = this.dtFrom.DateTime.Date.Ticks; } long dtBefore = 0; if (this.dtBefore.Text != "") { dtBefore = this.dtBefore.DateTime.Date.Ticks; } if (template != null) { identificationServerClient.DbSearch((int)spinEdit1.Value, Convert.ToSingle(tbScore.Text), dtFrom, dtBefore, cbSex.SelectedIndex, template); _startDate = DateTime.Now; marqueeProgressBarControl1.Visible = true; _maintimer.Enabled = true; break; } int num = (int)XtraMessageBox.Show(Messages.Error, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Hand); } catch (Exception ex) { int num = (int)XtraMessageBox.Show(ex.Message, Messages.IdentificationServerUnavailble, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } else { int num1 = (int)XtraMessageBox.Show(Messages.NoFaceWasFound, Messages.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }