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

📄 form1.frm

📁 IC卡编程
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3192
   ClientLeft      =   60
   ClientTop       =   348
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3192
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text1 
      Height          =   1095
      Left            =   480
      MultiLine       =   -1  'True
      TabIndex        =   0
      Top             =   480
      Width           =   3255
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IC_InitComm
'IC_ExitComm
'IC_InitType
'IC_Status
'IC_Read
'IC_Write
'IC_ReadCount_SLE4442%
'IC_CheckPass_4442hex%
'IC_ChangePass_4442hex%
Private Sub Form_Load()
    Dim com%, cardtype%
    Dim pass$
    Dim buffer As String * 512
    com% = 0    '串口1
    cardtype% = 16
    icdev = IC_InitComm(com%)
    If icdev < 0 Then
       st = IC_ExitComm(com%)
       End
    End If
    st = IC_InitType(icdev, cardtype%)
    '错误计数
    st = IC_ReadCount_SLE4442(ByVal icdev)
    '读卡
    buffer = "           "
    st = IC_Read_Hex(ByVal icdev, &H20, 10, ByVal buffer)
    Text1.Text = buffer
    '校验密码
    pass$ = "FFFFFF"
    st = IC_CheckPass_SLE4442hex(ByVal icdev, ByVal pass$)
    '写卡
    buffer = "000111222333AAA BBB aaa bbb"
    st = IC_Write(ByVal icdev, &H20, ByVal Len(Trim(buffer)), ByVal buffer)
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    st = IC_ExitComm(ByVal icdev)
End Sub

⌨️ 快捷键说明

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