|
Public Declare Function strtohex Lib "rfdll.dll" (ByRef source As Any, ByRef target As Any, ByVal wrlen As Long) As Long
Public Declare Function wrkey_t5557 Lib "hotel1.dll" (ByVal commhandle As Long, ByRef keyinfo As Any) As Long
Public Type KeyStruc
cardtype As Byte
HotelID(2) As Byte 'Hotel code
AreaID As Byte'Area number
FloorID As Byte 'Floor number
roomid As Byte 'room number
CardID As Byte 'Card serial number
OffOn As Byte '"Terminate the recovery flag
SDate(4) As Byte '"Start date
EDate(4) As Byte '"End date
STime(1) As Byte '"Service start time
ETime(1) As Byte '"Service termination time
FloorCot As Byte'Continue the number of floors
End Type
KeyStruc is a custom mechanism, the above is done in vb. The parameter of the above function is a member of this structure, which is the cardtype.
as follows:
dim cinfo as keystruc
with keystruc
.cardtype=1
.sdate(0)=&H18
...............
endwith
dim strtmp as string ="0701110805"
'Execute strtohex
call strtohex(strtmp,cinfo.sdate(0),5)
After executing the last sentence
Cinfo.sdate member values are as follows
cinfo.sdate(0)=&H07
cinfo.sdate(1)=&H01
cinfo.sdate(2)=&H11
By analogy, the first element of the cinfo.sdate array is passed to strtohex to get the above result.
vb6.0 can be implemented correctly.
However, the above results cannot be achieved in .net, but each array member of cinfo.sdate is 0
strtohex( |
|