|
楼主 |
发表于 2020-12-1 17:45:01
|
显示全部楼层
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 ' 酒店代号
AreaID As Byte ' 区域号
FloorID As Byte ' 楼层号
roomid As Byte ' 房间号
CardID As Byte ' 卡序号
OffOn As Byte ' "终止恢复标识
SDate(4) As Byte ' "起始日期
EDate(4) As Byte ' "结束日期
STime(1) As Byte ' "服务起始时间
ETime(1) As Byte ' "服务终止时间
FloorCot As Byte '延续楼层数
End Type
KeyStruc 是自定义的机构,以上是在vb里做的啊.上面的函数的参数传递的就是这个结构里的一个成员,就是那个cardtype.
如下:
dim cinfo as keystruc
with keystruc
.cardtype=1
.sdate(0)=&H18
...............
endwith
dim strtmp as string ="0701110805"
'执行 strtohex
call strtohex(strtmp,cinfo.sdate(0),5)
执行上个句子之后
cinfo.sdate成员值如下
cinfo.sdate(0)=&H07
cinfo.sdate(1)=&H01
cinfo.sdate(2)=&H11
依次类推.就是把cinfo.sdate数组的第一个元素传递给strtohex 得出如上结果.
vb6.0是可以正确实现的.
但是在.net里就实现不了上面的结果,而是 cinfo.sdate的每个数组成员都是0
strtohex(
|
|