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

📄 guanli.frm

📁 基于非接触IC的卡的一个综合功能的实现
💻 FRM
字号:
VERSION 5.00
Begin VB.Form guanli 
   Caption         =   "管理"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5025
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   5025
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cancel 
      Caption         =   "退 出"
      Height          =   375
      Left            =   2880
      TabIndex        =   12
      Top             =   2400
      Width           =   975
   End
   Begin VB.CommandButton decrease 
      Caption         =   "扣 除"
      Height          =   375
      Left            =   1680
      TabIndex        =   11
      Top             =   2400
      Width           =   975
   End
   Begin VB.CommandButton increase 
      Caption         =   "添 加"
      Height          =   375
      Left            =   480
      TabIndex        =   10
      Top             =   2400
      Width           =   975
   End
   Begin VB.TextBox glValue 
      Height          =   375
      Left            =   1080
      TabIndex        =   9
      Text            =   "Text1"
      Top             =   1680
      Width           =   2295
   End
   Begin VB.Label Label5 
      Caption         =   "操作数:"
      Height          =   375
      Left            =   240
      TabIndex        =   8
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label glCardValue 
      Caption         =   "Label5"
      Height          =   255
      Left            =   960
      TabIndex        =   7
      Top             =   1200
      Width           =   1815
   End
   Begin VB.Label glName 
      Caption         =   "Label5"
      Height          =   255
      Left            =   3240
      TabIndex        =   6
      Top             =   720
      Width           =   1455
   End
   Begin VB.Label glStudentsNo 
      Caption         =   "Label5"
      Height          =   255
      Left            =   960
      TabIndex        =   5
      Top             =   720
      Width           =   1335
   End
   Begin VB.Label glCardNo 
      Caption         =   "Label5"
      Height          =   255
      Left            =   960
      TabIndex        =   4
      Top             =   240
      Width           =   2655
   End
   Begin VB.Label Label4 
      Caption         =   "余额:"
      Height          =   255
      Left            =   240
      TabIndex        =   3
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label3 
      Caption         =   "姓名:"
      Height          =   255
      Left            =   2520
      TabIndex        =   2
      Top             =   720
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "学号:"
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   720
      Width           =   615
   End
   Begin VB.Label Label1 
      Caption         =   "卡号:"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   615
   End
End
Attribute VB_Name = "guanli"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim atemp As String

Private Sub cancel_Click()
    Unload Me
End Sub

Private Sub decrease_Click()
    Dim mima(6) As Byte
    Dim m1str As String * 32
    'readflag = 0
    'inputdata.Show 1
    cdblock = 61
    atemp = Str(Val(atemp) - Val(guanli.glValue.Text))
    For i = 0 To 15
        ReadBuff(i) = Val("&h" + Mid(Trim(atemp), i * 2 + 1, 2))
    Next i
    status = RFMifare_Write(cdblock, ReadBuff(0))
    
    If status = 0 Then
        MsgBox "数据写入成功!"
    Else
        MsgBox "数据写入失败!"
    End If

End Sub

Private Sub Form_Load()
    guanli.glValue.Text = ""
    guanli.glCardNo.Caption = ICMainForm.cardNo.Caption
    atemp = ""
    cdblock = 61
    status = RFMifare_Read(cdblock, ReadBuff(0))
        If status = 0 Then
            
            Dim atemp1 As String
            For i = 0 To 15
                atemp1 = Mid("00" + Hex(ReadBuff(i)), Len("00" + Hex(ReadBuff(i))) - 1)
                atemp = atemp1 + atemp
            Next i
                    
        End If
    guanli.glCardValue.Caption = Val(atemp)
    
    rsGrade.MoveFirst
    Do While Not rsGrade.EOF
        If (rsGrade.Fields("cardnumber") = ICMainForm.cardNo.Caption) Then
            guanli.glName.Caption = rsGrade.Fields("studentsname")
            guanli.glStudentsNo.Caption = rsGrade.Fields("studentsnumber")
            Exit Do
        End If
        rsGrade.MoveNext
    Loop
        
End Sub

Private Sub increase_Click()
    Dim mima(6) As Byte
    Dim m1str As String * 32
    'readflag = 0
    'inputdata.Show 1
    cdblock = 61
    atemp = Str(Val(atemp) + Val(guanli.glValue.Text))
    For i = 0 To 15
        ReadBuff(i) = Val("&h" + Mid(Trim(atemp), i * 2 + 1, 2))
    Next i
    status = RFMifare_Write(cdblock, ReadBuff(0))
    
    If status = 0 Then
        MsgBox "数据写入成功!"
    Else
        MsgBox "数据写入失败!"
    End If

End Sub

⌨️ 快捷键说明

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