📄 tm06.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "modifycard"
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 mvarcardtypeselected As cardtypeselects '局部复制
Public Enum cardtypeselects
mmastercard = 1
msecuritycard = 2
mfloorcard = 3
mGuestCard = 4
mterminatecard = 5
mregioncard = 7
mtimecard = 9
mdatacard = 10
End Enum
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 mvarmastercardpwd 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 = TModifyCard
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
ptemp = ptemp + "0101010101"
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
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 = ""
Select Case cardtypeselected
Case mmastercard
temp = "71"
Case msecuritycard
temp = "72"
Case mfloorcard
temp = "73"
Case mGuestCard
temp = "74"
Case mterminatecard
temp = "75"
Case mregioncard
temp = "77"
Case mtimecard
temp = "79"
Case mdatacard
temp = "7A"
Case Else
Err.Raise 60012, "modifycard.cardtypeselected", GetError(12)
Exit Function
End Select
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
ptemp = ptemp + "0000"
temp = Hex(regioncardpwd)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
ptemp = ptemp + "0000"
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 60091, , GetError(91)
tread = False
Exit Function
End If
If .cardtype <> TModifyCard 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -