7,763
社区成员
发帖
与我相关
我的任务
分享
Private Declare Function CVR_InitComm Lib "termb.dll" (ByVal Port As Integer) As Integer
Private Sub Command1_Click()
Dim iRet As Integer
iRet = CVR_InitComm(1001)
If Err Then
Err.Clear
MsgBox "端口错误", vbOKOnly, "提示"
Exit Sub
End If
If iRet <> 1 Then
Label1.Caption = iRet
MsgBox "初始化设备失败", vbOKOnly, "提示"
Exit Sub
End If
End Sub
初始化身份证
Public Function InitSFZ() As Boolean
Dim ret As Long, iPort As Long, iRetUSB As Integer
For iPort = 1001 To 1016
iRetUSB = CVR_InitComm(iPort)
If iRetUSB = 1 Then
ret = CVR_Read_Content(1)
InitSFZ = True
Exit Function
End If
Next
End Function