Tables(e.Form.name & "_Table1").AllowEdit=False
Dim bst As WinForm.Button = e.Form.Controls("card_confim")
Dim dr As Row=Tables("dev_info").Current
Dim iMachineNumber As String=dr("dev_no")
If Vars("d_Key01")=0 Then \'未启动刷卡
bIsConnected = axCZKEM1.Connect_Net(dr("dev_ip"), dr("dev_port")) \'连接到IP地址所指的卡上
If bIsConnected=True Then
AxCZKEM1.ClearGLog(iMachineNumber) \'先清除里面所有考勤记录
End If
Vars("d_Key01")=1
If bIsConnected=False Then \'如果已经连接好,就把它断开
Else
If bIsConnected Then
e.Form.TimerEnabled=True \'启动时时刷指纹
e.Form.TimerInterval=100
Tables(e.Form.name & "_Table1").AllowEdit=False
bst.text="...连机成功,正在签到中..."
bst.BackColor=Color.Lime
Else
bst.BackColor=Color.red
bst.text="设备连接失败"
messagebox.show("连接指纹器失败,请查相关设备连接状态!")
End If
End If
Else
Dim axCZKEM1 As New zkemkeeper.CZKEM
bst.text="签到结束"
Tables(e.Form.name & "_Table1").AllowEdit=True
bst.BackColor=Color.red
e.Form.TimerEnabled=False
Vars("d_Key01")=0
End If