各位老师,
看了VB的实例后,复制了相应的代码,但还是不能获取考勤机中的数据,麻烦帮忙修改一下代码,谢谢
此主题相关图片如下:图片111.png

Dim axCZKEM1 As New zkemkeeper.CZKEM
Dim bIsConnected = axCZKEM1.Connect_Net("192.168.0.103", "4370")
'Download the attendance records from the device.
' Private Sub btnGetGeneralLogData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetGeneralLogData.Click
If bIsConnected = False Then
MsgBox("Please connect the device first", MsgBoxStyle.Exclamation, "Error")
Return
End If
Dim sdwEnrollNumber As String = ""
Dim idwVerifyMode As Integer
Dim idwInOutMode As Integer
Dim idwYear As Integer
Dim idwMonth As Integer
Dim idwDay As Integer
Dim idwHour As Integer
Dim idwMinute As Integer
Dim idwSecond As Integer
Dim idwWorkcode As Integer
Dim iMachineNumber As Integer = 1
Dim lvlogs
Dim LvItem
Dim cursors,cursor
Dim idwErrorCode As Integer
Dim iGLCount = 0
‘ Dim lvItem As New ListViewItem("Items", 0) ’----这个地方设置有问题
Cursor = Cursors.WaitCursor
lvLogs.Items.Clear()
AxCZKEM1.EnableDevice(iMachineNumber, False) 'disable the device
If AxCZKEM1.ReadGeneralLogData(iMachineNumber) Then 'read all the attendance records to the memory
'get records from the memory
While AxCZKEM1.SSR_GetGeneralLogData(iMachineNumber, sdwEnrollNumber, idwVerifyMode, idwInOutMode, idwYear, idwMonth, idwDay, idwHour, idwMinute, idwSecond, idwWorkcode)
iGLCount += 1
lvItem = lvLogs.Items.Add(iGLCount.ToString())
lvItem.SubItems.Add(sdwEnrollNumber)
lvItem.SubItems.Add(idwVerifyMode.ToString())
lvItem.SubItems.Add(idwInOutMode.ToString())
lvItem.SubItems.Add(idwYear.ToString() & "-" + idwMonth.ToString() & "-" & idwDay.ToString() & " " & idwHour.ToString() & ":" & idwMinute.ToString() & ":" & idwSecond.ToString())
lvItem.SubItems.Add(idwWorkcode.ToString())
End While
Else
Cursor = Cursors.Default
AxCZKEM1.GetLastError(idwErrorCode)
If idwErrorCode <> 0 Then
MsgBox("Reading data from terminal failed,ErrorCode: " & idwErrorCode, MsgBoxStyle.Exclamation, "Error")
Else
MsgBox("No data from terminal returns!", MsgBoxStyle.Exclamation, "Error")
End If
End If
AxCZKEM1.EnableDevice(iMachineNumber, True) 'enable the device
Cursor = Cursors.Default