Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共25 条记录, 每页显示 10 条, 页签: [1] [2][3]
[浏览完整版]

标题:考勤机数据下载 代码 求助

1楼
yj249592026 发表于:2017/12/1 17:17:00

看到了FX的便利,以前学过一段时间VBA,所以想转来学FX,这两天做了个考勤系统,可以连接外部的中控考勤机了,但下载不了考勤机里面的数据,想求助一下高人,帮忙写一点下载考勤机数据的代码或给一些代码的提示,提前谢过了   QQ:249592026

 

     下面采集数据【下载数据】的代码   求助!!!!

 

     
图片点击可在新窗口打开查看此主题相关图片如下:图片1.png
图片点击可在新窗口打开查看

2楼
有点甜 发表于:2017/12/1 17:56:00

 对方不是有给你vb.net的实例么?去看看人家的例子和帮助

 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:中控考勤机.rar

3楼
yj249592026 发表于:2017/12/4 11:45:00

各位老师,

 

看了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
   

4楼
有点甜 发表于:2017/12/4 11:56:00

Dim iGLCount = 0
Dim idwErrorCode As Integer
Dim iMachineNumber As Integer = 1
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
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
        output.show(iGLCount.ToString())
        output.show(sdwEnrollNumber)
       
        output.show(idwVerifyMode.ToString())
        output.show(idwInOutMode.ToString())
        output.show(idwYear.ToString() & "-" + idwMonth.ToString() & "-" & idwDay.ToString() & " " & idwHour.ToString() & ":" & idwMinute.ToString() & ":" & idwSecond.ToString())
        output.show(idwWorkcode.ToString())
    End While
Else
    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

5楼
yj249592026 发表于:2017/12/4 14:16:00

”有点甜“老师:

 

不好意思,再问一下,把上面的代码写进去后,点击 获取数据 按钮,还是没有任何获取的数据出来,LISTVIEW及其它地方也没有显示数据,

要怎么调整一下,谢谢

 

 


图片点击可在新窗口打开查看此主题相关图片如下:图片100000.png
图片点击可在新窗口打开查看
6楼
yj249592026 发表于:2017/12/4 14:22:00
好象电脑也很容易卡死,FX没反应
7楼
有点甜 发表于:2017/12/4 15:01:00

output.show是在命令窗口显示的。

 

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

 

8楼
yj249592026 发表于:2017/12/4 15:53:00

哦,谢谢,在命令窗口是可以看见导出的数据,

 

那如果想要让数据在LISTVIEW或TABLE里面显示出来,该怎么样调整一下呢

9楼
有点甜 发表于:2017/12/4 16:01:00

参考代码


Dim iGLCount = 0
Dim idwErrorCode As Integer
Dim iMachineNumber As Integer = 1
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
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
    Dim t As Table = Tables("表A")
    While AxCZKEM1.SSR_GetGeneralLogData(iMachineNumber, sdwEnrollNumber, idwVerifyMode, idwInOutMode, idwYear, idwMonth, idwDay, idwHour, idwMinute, idwSecond, idwWorkcode)
        iGLCount += 1
        Dim nr As Row = t.addnew
        nr("第一列") = idwYear.ToString()
        nr("第二列") = iGLCount.ToString()

        output.show(iGLCount.ToString())
        output.show(sdwEnrollNumber)
        output.show(idwVerifyMode.ToString())
        output.show(idwInOutMode.ToString())
        output.show(idwYear.ToString() & "-" + idwMonth.ToString() & "-" & idwDay.ToString() & " " & idwHour.ToString() & ":" & idwMinute.ToString() & ":" & idwSecond.ToString())
        output.show(idwWorkcode.ToString())
    End While
Else
    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

10楼
yj249592026 发表于:2017/12/4 16:48:00
搞定了,谢谢,“有点甜”老师,你真厉害
共25 条记录, 每页显示 10 条, 页签: [1] [2][3]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03906 s, 3 queries.