frm3.frm
上传用户:lzd18710
上传日期:2009-11-26
资源大小:3595k
文件大小:20k
源码类别:

通讯编程

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form frm3 
  3.    Caption         =   "Demo"
  4.    ClientHeight    =   8085
  5.    ClientLeft      =   3330
  6.    ClientTop       =   1485
  7.    ClientWidth     =   8490
  8.    LinkTopic       =   "Form1"
  9.    MaxButton       =   0   'False
  10.    ScaleHeight     =   8085
  11.    ScaleWidth      =   8490
  12.    Begin VB.CommandButton cmdGetSN 
  13.       Caption         =   "GetSensorSN"
  14.       Height          =   375
  15.       Left            =   4080
  16.       TabIndex        =   31
  17.       Top             =   7080
  18.       Width           =   1575
  19.    End
  20.    Begin VB.TextBox txtFPTepLate1 
  21.       Height          =   1575
  22.       Left            =   5880
  23.       MultiLine       =   -1  'True
  24.       ScrollBars      =   2  'Vertical
  25.       TabIndex        =   29
  26.       Text            =   "frm3.frx":0000
  27.       Top             =   6480
  28.       Width           =   2535
  29.    End
  30.    Begin VB.CommandButton CmdFPConver 
  31.       Caption         =   "FPconverToBiokey"
  32.       Height          =   375
  33.       Left            =   4080
  34.       TabIndex        =   28
  35.       ToolTipText     =   "convert finger template to other template that it was used by Biokey SDK"
  36.       Top             =   6480
  37.       Width           =   1695
  38.    End
  39.    Begin VB.TextBox txtFPTepLate 
  40.       Height          =   1335
  41.       Left            =   5880
  42.       MultiLine       =   -1  'True
  43.       ScrollBars      =   2  'Vertical
  44.       TabIndex        =   26
  45.       Text            =   "frm3.frx":0006
  46.       Top             =   4680
  47.       Width           =   2535
  48.    End
  49.    Begin VB.TextBox txtDisableDeviceT 
  50.       Appearance      =   0  'Flat
  51.       Height          =   375
  52.       Left            =   6360
  53.       TabIndex        =   25
  54.       Top             =   3840
  55.       Width           =   1815
  56.    End
  57.    Begin VB.CommandButton cmdDisableDT 
  58.       Caption         =   " DisableDeviceWithTimeOut"
  59.       Height          =   375
  60.       Left            =   4080
  61.       TabIndex        =   24
  62.       Top             =   3840
  63.       Width           =   2175
  64.    End
  65.    Begin VB.CommandButton cmdBeep 
  66.       Caption         =   "Beep"
  67.       Height          =   375
  68.       Left            =   4080
  69.       TabIndex        =   23
  70.       Top             =   5640
  71.       Width           =   1575
  72.    End
  73.    Begin VB.CommandButton cmdPlayVoiceByIndex 
  74.       Caption         =   "PlayVoiceByIndex"
  75.       Height          =   375
  76.       Left            =   4080
  77.       TabIndex        =   22
  78.       Top             =   4440
  79.       Width           =   1575
  80.    End
  81.    Begin VB.CommandButton cmdRestartDevice 
  82.       Caption         =   "RestartDevice"
  83.       Height          =   375
  84.       Left            =   4080
  85.       TabIndex        =   21
  86.       Top             =   5040
  87.       Width           =   1575
  88.    End
  89.    Begin VB.TextBox txtProductCode 
  90.       Appearance      =   0  'Flat
  91.       Enabled         =   0   'False
  92.       Height          =   375
  93.       Left            =   5760
  94.       TabIndex        =   20
  95.       Top             =   3240
  96.       Width           =   2415
  97.    End
  98.    Begin VB.CommandButton cmdGetProductCode 
  99.       Caption         =   "GetProductCode"
  100.       Height          =   375
  101.       Left            =   4080
  102.       TabIndex        =   19
  103.       Top             =   3240
  104.       Width           =   1575
  105.    End
  106.    Begin VB.TextBox txtSDeviceMAC 
  107.       Appearance      =   0  'Flat
  108.       Height          =   375
  109.       Left            =   5760
  110.       TabIndex        =   18
  111.       Top             =   2040
  112.       Width           =   2415
  113.    End
  114.    Begin VB.CommandButton cmdSetDeviceMAC 
  115.       Caption         =   "SetDeviceMAC"
  116.       Height          =   375
  117.       Left            =   4080
  118.       TabIndex        =   17
  119.       Top             =   2040
  120.       Width           =   1575
  121.    End
  122.    Begin VB.TextBox txtSerialNumber 
  123.       Appearance      =   0  'Flat
  124.       Enabled         =   0   'False
  125.       Height          =   375
  126.       Left            =   5760
  127.       TabIndex        =   16
  128.       Top             =   2640
  129.       Width           =   2415
  130.    End
  131.    Begin VB.CommandButton cmdGetSerialNumber 
  132.       Caption         =   "GetSerialNumber"
  133.       Height          =   375
  134.       Left            =   4080
  135.       TabIndex        =   15
  136.       Top             =   2640
  137.       Width           =   1575
  138.    End
  139.    Begin VB.TextBox txtGetDeviceMAC 
  140.       Appearance      =   0  'Flat
  141.       Enabled         =   0   'False
  142.       Height          =   375
  143.       Left            =   5760
  144.       TabIndex        =   14
  145.       Top             =   1440
  146.       Width           =   2415
  147.    End
  148.    Begin VB.CommandButton cmdGetDeviceMAC 
  149.       Caption         =   "GetDeviceMAC"
  150.       Height          =   375
  151.       Left            =   4080
  152.       TabIndex        =   13
  153.       Top             =   1440
  154.       Width           =   1575
  155.    End
  156.    Begin VB.TextBox txtSetIP 
  157.       Appearance      =   0  'Flat
  158.       Height          =   375
  159.       Left            =   5760
  160.       TabIndex        =   12
  161.       Top             =   840
  162.       Width           =   2415
  163.    End
  164.    Begin VB.CommandButton cmdSetDeviceIP 
  165.       Caption         =   "SetDeviceIP"
  166.       Height          =   375
  167.       Left            =   4080
  168.       TabIndex        =   11
  169.       Top             =   840
  170.       Width           =   1575
  171.    End
  172.    Begin VB.TextBox txtDeviceIP 
  173.       Appearance      =   0  'Flat
  174.       Enabled         =   0   'False
  175.       Height          =   375
  176.       Left            =   5760
  177.       TabIndex        =   10
  178.       Top             =   240
  179.       Width           =   2415
  180.    End
  181.    Begin VB.CommandButton cmdGetDeviceIP 
  182.       Caption         =   "GetDeviceIP"
  183.       Height          =   375
  184.       Left            =   4080
  185.       TabIndex        =   9
  186.       Top             =   240
  187.       Width           =   1575
  188.    End
  189.    Begin VB.CommandButton cmdGetDevInfo 
  190.       Caption         =   "GetDeviceInfo"
  191.       Height          =   375
  192.       Left            =   120
  193.       TabIndex        =   8
  194.       Top             =   2880
  195.       Width           =   1455
  196.    End
  197.    Begin VB.ListBox ls2 
  198.       Appearance      =   0  'Flat
  199.       Height          =   4320
  200.       ItemData        =   "frm3.frx":0189
  201.       Left            =   120
  202.       List            =   "frm3.frx":018B
  203.       TabIndex        =   7
  204.       Top             =   3240
  205.       Width           =   3855
  206.    End
  207.    Begin VB.CommandButton cmdWriteLcd 
  208.       Caption         =   "WriteLCD"
  209.       Height          =   375
  210.       Left            =   120
  211.       TabIndex        =   6
  212.       Top             =   1680
  213.       Width           =   1455
  214.    End
  215.    Begin VB.ListBox ls1 
  216.       Height          =   2400
  217.       ItemData        =   "frm3.frx":018D
  218.       Left            =   1680
  219.       List            =   "frm3.frx":018F
  220.       TabIndex        =   5
  221.       Top             =   240
  222.       Width           =   2295
  223.    End
  224.    Begin VB.CommandButton cmdGetDeviStat 
  225.       Caption         =   "GetDeviceStatus"
  226.       Height          =   375
  227.       Left            =   120
  228.       TabIndex        =   4
  229.       Top             =   2400
  230.       Width           =   1455
  231.    End
  232.    Begin VB.CommandButton cmdDisEnableClock 
  233.       Caption         =   "DisEnableClock"
  234.       Height          =   375
  235.       Left            =   120
  236.       TabIndex        =   3
  237.       Top             =   1320
  238.       Width           =   1455
  239.    End
  240.    Begin VB.CommandButton cmdEnableClock 
  241.       Caption         =   "EnableClock"
  242.       Height          =   375
  243.       Left            =   120
  244.       TabIndex        =   2
  245.       Top             =   960
  246.       Width           =   1455
  247.    End
  248.    Begin VB.CommandButton cmdDisEnable 
  249.       Caption         =   "DisEnableDevice"
  250.       Height          =   375
  251.       Left            =   120
  252.       TabIndex        =   1
  253.       Top             =   600
  254.       Width           =   1455
  255.    End
  256.    Begin VB.CommandButton cmdEnable 
  257.       Caption         =   "EnableDevice"
  258.       Height          =   375
  259.       Left            =   120
  260.       TabIndex        =   0
  261.       Top             =   240
  262.       Width           =   1455
  263.    End
  264.    Begin VB.Label Label2 
  265.       Caption         =   "finger template for BIOKEY SDK"
  266.       Height          =   255
  267.       Left            =   5880
  268.       TabIndex        =   30
  269.       Top             =   6240
  270.       Width           =   2535
  271.    End
  272.    Begin VB.Label Label1 
  273.       Caption         =   "finger template for machine"
  274.       Height          =   375
  275.       Left            =   5880
  276.       TabIndex        =   27
  277.       Top             =   4320
  278.       Width           =   2535
  279.    End
  280. End
  281. Attribute VB_Name = "frm3"
  282. Attribute VB_GlobalNameSpace = False
  283. Attribute VB_Creatable = False
  284. Attribute VB_PredeclaredId = True
  285. Attribute VB_Exposed = False
  286. '**********************************************
  287. 'Time:2005-6-22                               *
  288. 'purpose:Demo                                 *
  289. 'author:YongHong Pei,work for zksoftware      *
  290. 'contact:pyhppp@hotmail.com                   *
  291. '**********************************************
  292. 'follow code get access testing by zkemsdk 5.10.90
  293. Private Sub cmdBeep_Click()
  294.     'Some machine does not,for example,F4 can
  295.     frm2.CZKEM1.Beep 150
  296. End Sub
  297. Private Sub cmdDisableDT_Click()
  298.     frm2.CZKEM1.DisableDeviceWithTimeOut CInt(frm2.txtMachNum.Text), CInt(txtDisableDeviceT.Text)
  299. End Sub
  300. Private Sub cmdDisEnable_Click()
  301.     'The device will be in work state
  302.     frm2.CZKEM1.EnableDevice CInt(frm2.txtMachNum.Text), False
  303. End Sub
  304. Private Sub cmdDisEnableClock_Click()
  305.     'pls look the time of machine
  306.     frm2.CZKEM1.EnableClock 0
  307. End Sub
  308. Private Sub cmdEnable_Click()
  309.     frm2.CZKEM1.EnableDevice CInt(frm2.txtMachNum.Text), True
  310. End Sub
  311. Private Sub cmdEnableClock_Click()
  312.     'pls look the time of machine
  313.     frm2.CZKEM1.EnableClock 1
  314. End Sub
  315. Private Sub CmdFPConver_Click()
  316.     Dim TmpData1
  317.     Dim TmpData2 As String
  318.     Dim Size As Long
  319.     TmpData1 = "ocojg52rWoEOOq1egQw1rEtBFp4uRAESmkBLQRZ0wlLBB21BKUEM3EIuQTPmKGhBCCm8fEkdw7MnQRE6QCXBC9DDVVEE3Kk3QR0iFjvBDRJAckEMz5VggQYbMn1BDy8uKwkNMItPyQ0VL0uBSJozS4FQhR8/ARSDoTHBIl0sIYEKQKYlghJDoxlBD02aKcERZJwaQRBbhioBKHkRS4EJhyUygVtEozPBPwi4PsEQij5DQQl8HXQJDZtkLBOrMM8LEBHCAgQPFBgPBoHAwgKjrfxTfBfAwgIEDKLaiZwdwMF1pKzLrMuqIcDBc6WZ693rmJrAwW+km87vzJmCwMFmoa3/DBWjy5qG"
  320.     
  321.     frm2.CZKEM1.FPTempConvertStr TmpData1, TmpData2, Size
  322.     txtFPTepLate1.Text = TmpData2
  323.     Size = Len(TmpData2)
  324. End Sub
  325. Private Sub cmdGetDeviceIP_Click()
  326.     Dim IPAddr As String
  327.     
  328.     frm2.CZKEM1.GetDeviceIP CInt(frm2.txtMachNum.Text), IPAddr
  329.     txtDeviceIP.Text = IPAddr
  330. End Sub
  331. Private Sub cmdGetDeviceMAC_Click()
  332.     Dim sMac As String
  333.     
  334.     frm2.CZKEM1.GetDeviceMAC CInt(frm2.txtMachNum.Text), sMac
  335.     txtGetDeviceMAC.Text = sMac
  336. End Sub
  337. Private Sub cmdGetDevInfo_Click()
  338.     Dim i As Integer
  339.     Dim dwValue As Long
  340.     Dim bget As Boolean
  341.     
  342.     For i = 1 To 35
  343.         bget = frm2.CZKEM1.GetDeviceInfo(CInt(frm2.txtMachNum.Text), i, dwValue)
  344.         If bget = False Then Exit Sub
  345.         If i = 1 Then
  346.             ls2.AddItem "Max num of manager:" & dwValue & ""
  347.             ls2.Refresh
  348.         End If
  349.         If i = 2 Then
  350.             ls2.AddItem "Machine num:" & dwValue & ""
  351.             ls2.Refresh
  352.         End If
  353.         If i = 3 Then
  354.             If dwValue = 0 Then
  355.                 ls2.AddItem "Lanage:English"
  356.                 ls2.Refresh
  357.             ElseIf dwValue = 1 Then
  358.                 ls2.AddItem "Lanage:Chinese"
  359.                 ls2.Refresh
  360.             ElseIf dwValue = 2 Then
  361.                 ls2.AddItem "Lanage:Korea"
  362.                 ls2.Refresh
  363.             End If
  364.         End If
  365.         If i = 4 Then
  366.             ls2.AddItem "Close Machine self-motion time:" & dwValue & "M"
  367.             ls2.Refresh
  368.         End If
  369.         If i = 5 Then
  370.                 ls2.AddItem "Export signal of controling mentor:" & dwValue & ""
  371.                 ls2.Refresh
  372.         End If
  373.         If i = 6 Then
  374.                 ls2.AddItem "Max num of Attdance alarm:" & dwValue & ""
  375.                 ls2.Refresh
  376.         End If
  377.         If i = 7 Then
  378.                 ls2.AddItem "Max num of manage newsreel alarm:" & dwValue & ""
  379.                 ls2.Refresh
  380.         End If
  381.         If i = 8 Then
  382.             ls2.AddItem "Min space of two validate:" & dwValue & ""
  383.             ls2.Refresh
  384.         End If
  385.         If i = 9 Then
  386.             If dwValue <> 6 Then
  387.                 ls2.AddItem "Rate:" & 1200 * (dwValue + 1) & "bps"
  388.                 ls2.Refresh
  389.             Else
  390.                 ls2.AddItem "Rate:115200bps"
  391.                 ls2.Refresh
  392.             End If
  393.         End If
  394.         If i = 10 Then
  395.             If dwValue = 0 Then
  396.                 ls2.AddItem "parity check:NO"
  397.                 ls2.Refresh
  398.             ElseIf dwValue = 1 Then
  399.                 ls2.AddItem "Parity check:even"
  400.                 ls2.Refresh
  401.             ElseIf dwValue = 2 Then
  402.                 ls2.AddItem "Parity check:odd"
  403.                 ls2.Refresh
  404.             End If
  405.         End If
  406.         If i = 11 Then
  407.             ls2.AddItem "Stop sing:" & (dwValue + 1) * 2 & "Bits"
  408.             ls2.Refresh
  409.         End If
  410.         If i = 12 Then
  411.             If dwValue = 0 Then
  412.                 ls2.AddItem "Data segmentation sign:" / ""
  413.                 ls2.Refresh
  414.             ElseIf dwValue = 1 Then
  415.                 ls2.AddItem "Data segmentation sign:-"
  416.                 ls2.Refresh
  417.             End If
  418.         End If
  419.         If i = 13 Then
  420.             If dwValue = 1 Then
  421.                 ls2.AddItem "Connect net:YES"
  422.                 ls2.Refresh
  423.             ElseIf dwValue = 0 Then
  424.                 ls2.AddItem "Connect net:NO"
  425.                 ls2.Refresh
  426.             End If
  427.         End If
  428.         If i = 14 Then
  429.             If dwValue = 1 Then
  430.                 ls2.AddItem "RS232 Connect:YES"
  431.                 ls2.Refresh
  432.             ElseIf dwValue = 0 Then
  433.                 ls2.AddItem "RS232 Connect:NO"
  434.                 ls2.Refresh
  435.             End If
  436.         End If
  437.         If i = 15 Then
  438.             If dwValue = 1 Then
  439.                 ls2.AddItem "RS485 Connect:YES"
  440.                 ls2.Refresh
  441.             ElseIf dwValue = 0 Then
  442.                 ls2.AddItem "RS485 Connect:NO"
  443.                 ls2.Refresh
  444.             End If
  445.         End If
  446.         If i = 16 Then
  447.             If dwValue = 1 Then
  448.                 ls2.AddItem "voice register:YES"
  449.                 ls2.Refresh
  450.             Else
  451.                 ls2.AddItem "voice register:NO"
  452.                 ls2.Refresh
  453.             End If
  454.         End If
  455.         If i = 17 Then
  456.             ls2.AddItem "validate speed:" & dwValue & ""
  457.             ls2.Refresh
  458.         End If
  459.         If i = 18 Then
  460.             ls2.AddItem "idlesse times:" & dwValue & ""
  461.             ls2.Refresh
  462.         End If
  463.         If i = 19 Then
  464.             ls2.AddItem "time of closing machine:" & dwValue & ""
  465.             ls2.Refresh
  466.         End If
  467.         If i = 20 Then
  468.             ls2.AddItem "time of setup machine:" & dwValue & ""
  469.             ls2.Refresh
  470.         End If
  471.         If i = 21 Then
  472.             ls2.AddItem "time of sleep:" & dwValue & ""
  473.             ls2.Refresh
  474.         End If
  475.         If i = 22 Then
  476.             ls2.AddItem "self-motion beep:" & dwValue & ""
  477.             ls2.Refresh
  478.         End If
  479.         If i = 23 Then
  480.             ls2.AddItem "Match threhold:" & dwValue & ""
  481.             ls2.Refresh
  482.         End If
  483.         If i = 24 Then
  484.             ls2.AddItem "mistach threshord:" & dwValue & ""
  485.             ls2.Refresh
  486.         End If
  487.         If i = 25 Then
  488.             If dwValue = 1 Then
  489.                 ls2.AddItem "1:1:YES"
  490.                 ls2.Refresh
  491.             Else
  492.                 ls2.AddItem "1:1:NO"
  493.                 ls2.Refresh
  494.             End If
  495.         End If
  496.         If i = 26 Then
  497.             If dwValue = 1 Then
  498.                 ls2.AddItem "Show score:YES"
  499.                 ls2.Refresh
  500.             Else
  501.                 ls2.AddItem "Show score:NO"
  502.                 ls2.Refresh
  503.             End If
  504.         End If
  505.         If i = 27 Then
  506.             ls2.AddItem "Combination number of unlock persons:" & dwValue & ""
  507.             ls2.Refresh
  508.         End If
  509.         If i = 28 Then
  510.             If dwValue = 1 Then
  511.                 ls2.AddItem "Whether to use card for verification:YES"
  512.                 ls2.Refresh
  513.             Else
  514.                 ls2.AddItem "Whether to use card for verification:NO"
  515.                 ls2.Refresh
  516.             End If
  517.         End If
  518.         If i = 29 Then
  519.             ls2.AddItem "Network speed:" & dwValue & ""
  520.             ls2.Refresh
  521.         End If
  522.         If i = 30 Then
  523.             If dwValue = 1 Then
  524.                 ls2.AddItem "Must register card No:YES"
  525.                 ls2.Refresh
  526.             Else
  527.                 ls2.AddItem "Must register card No:NO"
  528.                 ls2.Refresh
  529.             End If
  530.         End If
  531.         If i = 31 Then
  532.             ls2.AddItem "retention time for machine under temporary status:" & dwValue & ""
  533.             ls2.Refresh
  534.         End If
  535.         If i = 32 Then
  536.             ls2.AddItem "Type retention time:" & dwValue & ""
  537.             ls2.Refresh
  538.         End If
  539.         If i = 33 Then
  540.             ls2.AddItem "Retention time for menu:" & dwValue & ""
  541.             ls2.Refresh
  542.         End If
  543.         If i = 34 Then
  544.             ls2.AddItem "Date formate:" & dwValue & ""
  545.             ls2.Refresh
  546.         End If
  547.         If i = 35 Then
  548.             If dwValue = 1 Then
  549.                 ls2.AddItem "Whether is 1: 1 match or not?:YES"
  550.                 ls2.Refresh
  551.             Else
  552.                 ls2.AddItem "Whether is 1: 1 match or not?:NO"
  553.                 ls2.Refresh
  554.             End If
  555.         End If
  556.     Next i
  557. End Sub
  558. Private Sub cmdGetDeviStat_Click()
  559.     Dim i As Integer
  560.     Dim dwValue As Long
  561.     
  562.     For i = 1 To 6
  563.         frm2.CZKEM1.GetDeviceStatus CInt(frm2.txtMachNum.Text), i, dwValue
  564.         If i = 1 Then
  565.             ls1.AddItem "Manage number:" & dwValue & ""
  566.             ls1.Refresh
  567.         End If
  568.         If i = 2 Then
  569.             ls1.AddItem "User number:" & dwValue & ""
  570.             ls1.Refresh
  571.         End If
  572.         If i = 3 Then
  573.             ls1.AddItem "Finger templata number:" & dwValue & ""
  574.             ls1.Refresh
  575.         End If
  576.         If i = 4 Then
  577.             ls1.AddItem "PassWord number:" & dwValue & ""
  578.             ls1.Refresh
  579.         End If
  580.         If i = 5 Then
  581.             ls1.AddItem "Manage run number:" & dwValue & ""
  582.             ls1.Refresh
  583.         End If
  584.         If i = 6 Then
  585.             ls1.AddItem "Attdance number:" & dwValue & ""
  586.             ls1.Refresh
  587.         End If
  588.     Next
  589. End Sub
  590. Private Sub cmdGetProductCode_Click()
  591.     Dim lpsxProductCode As String
  592.     
  593.     frm2.CZKEM1.GetProductCode CInt(frm2.txtMachNum.Text), lpsxProductCode
  594.     txtProductCode.Text = lpsxProductCode
  595. End Sub
  596. Private Sub cmdGetSerialNumber_Click()
  597.     Dim dwSerialNumber As String
  598.     
  599.     frm2.CZKEM1.GetSerialNumber CInt(frm2.txtMachNum.Text), dwSerialNumber
  600.     txtSerialNumber.Text = dwSerialNumber
  601. End Sub
  602. Private Sub cmdGetSN_Click()
  603.     Dim SensorSN As String
  604.     
  605.     frm2.CZKEM1.GetSensorSN 1, SensorSN
  606. End Sub
  607. Private Sub cmdSetDeviceIP_Click()
  608.     frm2.CZKEM1.SetDeviceIP CInt(frm2.txtMachNum.Text), txtSetIP.Text
  609. End Sub
  610. Private Sub cmdSetDeviceMAC_Click()
  611.     frm2.CZKEM1.SetDeviceMAC CInt(frm2.txtMachNum.Text), txtSDeviceMAC.Text
  612. End Sub
  613. Private Sub cmdWriteLcd_Click()
  614.     frm2.CZKEM1.ClearLCD
  615.     frm2.CZKEM1.EnableClock 0
  616.     frm2.CZKEM1.WriteLCD 0, 0, "God!God!What are"
  617.     frm2.CZKEM1.WriteLCD 1, 0, "you doing!!!"
  618. End Sub
  619. Private Sub cmdRestartDevice_Click()
  620.     frm2.CZKEM1.RestartDevice CInt(frm2.txtMachNum.Text)
  621. End Sub
  622. Private Sub cmdPlayVoiceByIndex_Click()
  623.     frm2.CZKEM1.PlayVoiceByIndex 2
  624. End Sub