解析一个二进制文件,自定义了一个结构,准备用这个结构读取文件,但是发生异常
解析一个二进制文件,自定义了一个结构,准备用这个结构读取文件,但是发生错误。
结构定义如下:
Public Structure UserData
Public bytUserID() As Byte
Public bytCard1Kind As Byte
Public bytCard1PW() As Byte
Public bytCard2Kind As Byte
Public bytCard2PW() As Byte
Public bytUserProperty As Byte '属性
Public bytDoorPower As Byte
Public bytPassPower() As Byte '通行権限番号
Public bytStartTime() As Byte
Public bytEndTime() As Byte
Public chrCardFalse As Char
Public bytCardReturn As Byte
Public bytCardPassWord() As Byte
Public bytFingerStart() As Byte
Public bytFingerEnd() As Byte
Public chrFingerFalse As Char
Public bytFingerReturn As Byte
Public bytFingerPW() As Byte
Public usNextPointer As Int16
Public usBeforePointer2 As Int16
Public usNextPointer2 As Int16
Public usBeforePointer3 As Int16
Public usNextPointer3 As Int16
Public Property ID()
Get
ID = bytUserID.Length - 1
End Get
Set(ByVal value)
ReDim bytUserID(value)
End Set
End Property
结构定义如下:
Public Structure UserData
Public bytUserID() As Byte
Public bytCard1Kind As Byte
Public bytCard1PW() As Byte
Public bytCard2Kind As Byte
Public bytCard2PW() As Byte
Public bytUserProperty As Byte '属性
Public bytDoorPower As Byte
Public bytPassPower() As Byte '通行権限番号
Public bytStartTime() As Byte
Public bytEndTime() As Byte
Public chrCardFalse As Char
Public bytCardReturn As Byte
Public bytCardPassWord() As Byte
Public bytFingerStart() As Byte
Public bytFingerEnd() As Byte
Public chrFingerFalse As Char
Public bytFingerReturn As Byte
Public bytFingerPW() As Byte
Public usNextPointer As Int16
Public usBeforePointer2 As Int16
Public usNextPointer2 As Int16
Public usBeforePointer3 As Int16
Public usNextPointer3 As Int16
Public Property ID()
Get
ID = bytUserID.Length - 1
End Get
Set(ByVal value)
ReDim bytUserID(value)
End Set
End Property