응용 프로그램이 특정 바코드 (예 : 동일한 문자 길이 또는 RegEx와 일치 할 수있는 문자)로 작동하는 경우 로봇 타이핑 테스트를 코딩하여 해결할 수 있습니다. 예 :
VB.Net :
Private sw As Stopwatch
Private Sub FirstCharacterEntered()
sw.Start()
End Sub
Private Sub txt_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt.TextChanged
If txt.length = 0 Then FirstCharacterEntered()
If txt.Length = BarCodeSerialLength Or New RegularExpressions.Regex("your pattern").IsMatch(txt.Text) Then
sw.Stop()
If sw.ElapsedMilliseconds < TimeAHumanWouldTakeToType Then
'Input is from the BarCode Scanner
End If
End If
End Sub
C 번호 :
private Stopwatch sw;
private void FirstCharacterEntered()
{
sw.Start();
}
private void txt_TextChanged(System.Object sender, System.EventArgs e)
{
if (txt.length == 0)
FirstCharacterEntered();
if (txt.Length == BarCodeSerialLength | new RegularExpressions.Regex("your pattern").IsMatch(txt.Text)) {
sw.Stop();
if (sw.ElapsedMilliseconds < TimeAHumanWouldTakeToType) {
//Input is from the BarCode Scanner
}
}
}
스캐너가 시스템 장치 관리자의 HID 키보드 장치이면 키보드입니다. – Enigmativity