Skip to content

Commit 89b8bda

Browse files
committed
1. To use "Key code" to replace sn.
2. To prevent IdentifyTheKeyLED_Click freeze main UI thread.
1 parent e40f850 commit 89b8bda

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

WindowsFormsTest/WinBioForm.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected override void OnLoad(EventArgs e)
7373
Log(string.Format(" Firmware: {0}", strFirmwareVersion));
7474

7575
int lastInvSlash = units[i].DeviceInstanceId.LastIndexOf("\\");
76-
Log(string.Format(" sn: {0}",
76+
Log(string.Format(" Key code: {0}",
7777
strDeviceInstanceId.Substring(lastInvSlash+1, strDeviceInstanceId.Length - lastInvSlash - 1)));
7878
}
7979

@@ -315,20 +315,22 @@ private string getFirmwareVersion(string deviceInstanceId)
315315

316316
private void IdentifyTheKeyLED_Click(object sender, EventArgs e)
317317
{
318-
try
319-
{
320-
WinBioRejectDetail rejectDetail;
321-
Log(string.Format("Please touch session: unit id {0} in flashing", _unitId));
322-
WinBio.EnrollBegin(_session, WinBioBiometricSubType.LhThumb, _unitId);
323-
WinBio.EnrollCapture(_session, out rejectDetail);
324-
WinBio.EnrollDiscard(_session);
325-
Log(string.Format("Done"));
326-
}
327-
catch (WinBioException ex)
318+
ThreadPool.QueueUserWorkItem(delegate
328319
{
329-
//ignore
330-
}
331-
320+
try
321+
{
322+
WinBioRejectDetail rejectDetail;
323+
Log(string.Format("Please touch session: unit id {0} in flashing", _unitId));
324+
WinBio.EnrollBegin(_session, WinBioBiometricSubType.LhThumb, _unitId);
325+
WinBio.EnrollCapture(_session, out rejectDetail);
326+
WinBio.EnrollDiscard(_session);
327+
Log(string.Format("Done"));
328+
}
329+
catch (WinBioException ex)
330+
{
331+
//ignore
332+
}
333+
});
332334
}
333335
}
334336
}

0 commit comments

Comments
 (0)