private void FindDevice() { _arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); _arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(true); comboBoxSerialRFID.Items.Clear(); if (_arrayOfPluggedDevice != null) { foreach (rfidPluggedInfo dev in _arrayOfPluggedDevice) { comboBoxSerialRFID.Items.Add(dev.SerialRFID); } } else { MessageBox.Show("No device found"); } _fpDevArray = tmp.getFingerprintPluggedGUID(); tmp.ReleaseDevice(); comboBoxSerialFPMaster.Items.Clear(); comboBoxSerialFPSlave.Items.Clear(); if (_fpDevArray != null) { foreach (string fpDev in _fpDevArray) { comboBoxSerialFPMaster.Items.Add(fpDev); comboBoxSerialFPSlave.Items.Add(fpDev); } } }
//Function to discover device //This function will search all the RFID device and fingerprint plugged on the PC //Take care to choose the good value depending of the serial numbers printed on the device. private void FindDevice() { arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(false); fpDevArray = tmp.getFingerprintPluggedGUID(); tmp.ReleaseDevice(); comboBoxDevice.Items.Clear(); if (arrayOfPluggedDevice != null) { foreach (rfidPluggedInfo dev in arrayOfPluggedDevice) { comboBoxDevice.Items.Add(dev.SerialRFID); } } comboBoxFP.Items.Clear(); if (fpDevArray != null) { foreach (string fpDev in fpDevArray) { comboBoxFP.Items.Add(fpDev); } } if ((comboBoxDevice.Items.Count > 0) && (comboBoxFP.Items.Count > 0)) { comboBoxDevice.SelectedIndex = 0; comboBoxFP.SelectedIndex = 0; buttonCreate.Enabled = true; } else { buttonCreate.Enabled = false; Invoke((MethodInvoker) delegate { toolStripStatusLabelInfo.Text = "Info : No RFID and/or Fingerprint detected - try Refresh"; }); } }