Foxtable(狐表)用户栏目专家坐堂 → 关于CVR-100U


  共有2155人关注过本帖树形打印复制链接

主题:关于CVR-100U

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/11/26 9:08:00 [显示全部帖子]

afterLoad事件,写代码

 

Try
    Dim lb1 As WinForm.Label = e.Form.Controls("Label1")
    Dim iRetUSB As Integer
    For iPort As Integer = 1001 To 1016 '遍历端口号
        iRetUSB = CVR_InitComm(iPort)
        If iRetUSB = 1 Then
            Exit For
        End If
    Next
    If iRetUSB = 1 Then
        lb1.Text = "设备连接成功"
        'e.Form.TimerEnabled = True

        e.Form.Controls("CheckBox1").Checked = False

        e.Form.TimerEnabled = False '停止计时器,使得自动读取功能失效
    Else
        lb1.Text = "设备连接失败"
        e.Form.TimerEnabled = False '停止计时器,使得自动读取功能失效
        e.Form.Controls("Button1").Enabled = False '禁用读卡按钮
        e.Form.Controls("CheckBox1").Enabled = False '禁用自动读取复选框
    End If
Catch ex As Exception
    MessageBox.Show(ex.ToString)
End Try


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/11/26 17:38:00 [显示全部帖子]

全局代码,加入

 

http://www.foxtable.com/webhelp/scr/1842.htm

 

Public Declare Function CVR_InitComm Lib "termb.dll" Alias "CVR_InitComm" (ByVal Port As Integer) As Integer '连接设备
Public Declare Function CVR_Authenticate Lib "termb.dll" Alias "CVR_Authenticate" () As Integer '验证身份证
Public Declare Function CVR_Read_Content Lib "termb.dll" Alias "CVR_Read_Content" (ByVal Active As Integer) As Integer '读取身份证信息
Public Declare Function CVR_CloseComm Lib "termb.dll" Alias "CVR_CloseComm" () As Integer '关闭设备

 

http://www.foxtable.com/webhelp/scr/2417.htm

 


 回到顶部