⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsetm1.frm

📁 一个完整的非接触IC卡会员管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmSetM1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "发卡(开门卡登记)"
   ClientHeight    =   7044
   ClientLeft      =   12
   ClientTop       =   408
   ClientWidth     =   9708
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7044
   ScaleWidth      =   9708
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command4 
      Caption         =   "登记"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   6000
      TabIndex        =   16
      Top             =   840
      Width           =   1452
   End
   Begin VB.CommandButton Command3 
      Caption         =   "查询"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.4
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6000
      TabIndex        =   11
      Top             =   1320
      Width           =   1450
   End
   Begin VB.CommandButton Command2 
      Caption         =   "验卡"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.4
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6000
      TabIndex        =   9
      Top             =   360
      Width           =   1450
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.4
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   370
      Left            =   7680
      TabIndex        =   7
      Top             =   1320
      Width           =   1450
   End
   Begin VB.Frame Frame1 
      Caption         =   "卡信息"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2050
      Left            =   240
      TabIndex        =   2
      Top             =   240
      Width           =   5050
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   336
         Left            =   1560
         TabIndex        =   15
         Text            =   "Combo1"
         Top             =   360
         Width           =   2412
      End
      Begin VB.OptionButton Option2 
         Caption         =   "白名单"
         Height          =   252
         Left            =   3000
         TabIndex        =   14
         Top             =   1560
         Width           =   1692
      End
      Begin VB.OptionButton Option1 
         Caption         =   "黑名单"
         Height          =   252
         Left            =   1560
         TabIndex        =   13
         Top             =   1560
         Value           =   -1  'True
         Width           =   1332
      End
      Begin VB.TextBox txtCardNO 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.8
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   1560
         MaxLength       =   6
         TabIndex        =   4
         Top             =   720
         Width           =   1570
      End
      Begin VB.TextBox txtName 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.8
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   370
         Left            =   1560
         TabIndex        =   3
         Top             =   1080
         Width           =   1570
      End
      Begin VB.Label Label4 
         Caption         =   "卡类标志:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   372
         Left            =   240
         TabIndex        =   12
         Top             =   1560
         Width           =   1212
      End
      Begin VB.Label Label2 
         Caption         =   "物理卡号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.8
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   264
         Left            =   240
         TabIndex        =   10
         Top             =   360
         Width           =   1812
      End
      Begin VB.Label Label1 
         Caption         =   "持卡人姓名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.8
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   264
         Left            =   240
         TabIndex        =   6
         Top             =   1080
         Width           =   1452
      End
      Begin VB.Label Label3 
         Caption         =   "卡流水号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.8
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   264
         Left            =   240
         TabIndex        =   5
         Top             =   720
         Width           =   1812
      End
   End
   Begin VB.CommandButton cmdDel 
      Caption         =   "删除"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.4
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   7680
      TabIndex        =   1
      Top             =   840
      Width           =   1452
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "发卡"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.4
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   7680
      TabIndex        =   0
      Top             =   360
      Width           =   1450
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   4210
      Left            =   240
      TabIndex        =   8
      Top             =   2520
      Width           =   9130
      _ExtentX        =   16108
      _ExtentY        =   7430
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   11.4
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   0
   End
End
Attribute VB_Name = "frmSetM1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim pscard As New ADODB.Recordset '本地临时库
Dim rs As New ADODB.Recordset
Dim pssql As String
Dim M1Key As String
Dim data32 As String * 32

Dim txtMoney As Currency
Dim pbout(3) As Byte
Dim CardId As String

Dim blOperResult As Boolean  '操作结果(Boolean)
Dim bOperResult As Byte '操作结果(BYTE)
Dim SerialNum(4) As Byte  '物理卡号缓冲
Dim aKey(6) As Byte '密钥
Dim databuff32(16) As Byte
Dim s15(16) As Byte
Dim pbTemp(100) As Byte
Dim pbExdest(100) As Byte

Dim pbKeyA(6) As Byte
Dim pbKeyB(6) As Byte
Dim pbKeyD(6) As Byte
Dim pbKeyID(8) As Byte

Dim i As Integer
Dim str As String
Dim stValue(3) As Byte


Private Sub cmdAdd_Click() '新增开门卡

If Combo1.Text <> "" And txtCardNo.Text <> "" And txtName.Text <> "" Then
    Set rs = GetRecordset(maSys_db, "select *  from Full_UserDict where m1cardid='" & Trim(txtCardID) & "' or userid='" & Trim(Format(txtCardNo, "000000")) & "'")
    If Not (rs.EOF And rs.BOF) Then
        MsgBox "该卡号在数据库中已经存在,请检查!", vbInformation + vbOKOnly, "提示"
    Else
        blOperResult = ConnectionUSBDevice()
        If (blOperResult) Then
            
        Else
            GoTo Err1:
        End If
        DoEvents
        
        '先判断密码卡有决有装载过
        
        If Not KeyABP Then
            For i = 0 To 7
                KeyAP(i) = &H11
                KeyBP(i) = &H11
                KeyABP = True
            Next
        End If
        
        '
        bOperResult = MIFARE_SelectCard(SerialNum(0))
        If bOperResult <> 0 Then
             GoTo Err1:
        End If
        
        For i = 0 To 3
            pbKeyID(i) = SerialNum(i)
            pbKeyID(i + 4) = SerialNum(i)
        Next
        '-----------------------------------------计算KEYA KEYB
        st = ic_encrypt(KeyAP(0), pbKeyID(0), 8, pbExdest(0)) 'KEYA
        If st <> 0 Then GoTo Err1:
        For i = 0 To 5
            pbKeyA(i) = pbExdest(i)
        Next
        
        st = ic_encrypt(KeyBP(0), pbKeyID(0), 8, pbExdest(0)) 'KEYB
        If st <> 0 Then GoTo Err1:
        For i = 0 To 5
            pbKeyB(i) = pbExdest(i)
        Next
        
        '出厂卡密码
        For i = 0 To 5
           pbKeyD(i) = &HFF
        Next
        
        bOperResult = MIFARE_LoginSector(2, 0, pbKeyD(0))
        If bOperResult <> 0 Then GoTo Err1:
        
        For i = 0 To 15
            databuff32(i) = &H0
        Next
        
        str = hex(CDbl(Val(txtCardNo)))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -