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

📄 tm08.cls

📁 这是一个银行IC卡门禁系统软件
💻 CLS
📖 第 1 页 / 共 2 页
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "InitializeCard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Private mvarbuilding As Byte '局部复制
Private mvarcardno As Long '局部复制
Private mvarcardpwd As Long '局部复制
Private mvarcardtype As JalTMCardType
Private mvarcleanmemoryflag As Boolean '局部复制
Private mvardatacardpwd As Long '局部复制
Private mvarfloor As Byte '局部复制
Private mvarfloorcardpwd As Long '局部复制
Private mvarguestcardpwd As Long '局部复制
Private mvarhotelcode As Long '局部复制
Private mvarhotelpwd As Long '局部复制
Private mvarinitealizecardpwd As Long '局部复制

Private mvarmastercardpwd As Long '局部复制
Private mvarmodifycardpwd As Long '局部复制
Private mvaroperatorid As Long '局部复制
Private mvarregioncardpwd As Long '局部复制
Private mvarroom As Byte '局部复制
Private mvarsecuritycardpwd As Long '局部复制
Private mvarterminatecardpwd As Long '局部复制
Private mvartimecardpwd As Long '局部复制
Private mvaruserid As Long '局部复制

Public Property Let userid(ByVal vData As Long)

    mvaruserid = vData

End Property

Public Property Get userid() As Long

    userid = mvaruserid

End Property

Public Function twrite() As Boolean

    Dim ptemp As String
    Dim temp As String
    Dim ntemp As String
    Dim i As Integer
    
    Dim card1 As New tmreadtype
    Set card1 = New tmreadtype
    
    With card1
        
        .treadtype
        temp = .romid
        i = CLng("&H" + Mid(temp, 15, 2))

        If i <> 2 Then

            Err.Raise 60091, , GetError(91)
            twrite = False
            Exit Function

        End If
    
    End With
    
    cardtype = TInitializeCard
    
    ptemp = ""
    
    temp = Hex(cardtype)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(cardno)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(hotelcode)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    ptemp = ptemp + "010101"
        
    temp = Hex(hotelcode)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(cardtype)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(cardtype)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(255 - cardtype)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(65535 - cardno)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    ptemp = ptemp + "01"
    
    temp = Hex(building)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(floor)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(room)

    While Len(temp) < 2

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = ""

    If CleanMemoryFlag Then

        temp = "00"

    Else

        temp = "FF"

    End If

    ptemp = ptemp + temp

    temp = Hex(hotelcode)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(hotelpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    ptemp = ptemp + "0000"
    
    temp = Hex(mastercardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(securitycardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(floorcardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(guestcardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp

    temp = Hex(terminatecardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(modifycardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp

    temp = Hex(regioncardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(initealizecardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(timecardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(datacardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(cardpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(operatorid)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = Hex(userid)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    ptemp = ptemp + "00000000"
    
    ptemp = ptemp + "0000000000000000"
    
    twrite = tm91.writesub1(ptemp)
    
End Function

Public Function tread() As Boolean

    Dim ptemp As String
    Dim temp As String
    Dim tmcardmark As String
    Dim i As Integer
    Dim card1 As New tmreadtype
    Set card1 = New tmreadtype
    
    With card1
        
        .treadtype
        temp = .romid
        i = CLng("&H" + Mid(temp, 15, 2))

        If i <> 2 Then

            Err.Raise 60005, , GetError(5)
            tread = False
            Exit Function

        End If
        
        If .cardtype <> TInitializeCard Then

            Err.Raise 60005, , GetError(5)
            tread = False
            Exit Function

        End If
  
    End With
    
    temp = ""
    ptemp = ""
    temp = Hex(hotelcode)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = ""
    temp = Hex(hotelpwd)

    While Len(temp) < 4

        temp = "0" + temp

    Wend

    ptemp = ptemp + temp
    
    temp = ""
    temp = ptemp
    ptemp = ""
    ptemp = tm91.readsub1(temp)
    
    If (ptemp = "") Or (Len(ptemp) <> 128) Then
        
        tread = False
    
    Else
        
        tread = True
        
        temp = Mid(ptemp, 1, 2)
        cardtype = CLng("&H" + temp)
        
        temp = Mid(ptemp, 3, 4)
        cardno = CLng("&H" + temp)
        
        temp = Mid(ptemp, 17, 4)

⌨️ 快捷键说明

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