|
Private Type UnlockType1
UnlockLine As String * 5
End Type
Private Type UnlockType2
UnlockLine As String * 4
End Type
Private Type UnlockType3
UnlockLine As String * 2
End Type
Private Type UnlockType4
UnlockLine As String * 1
End Type
Private Type UnlockType5
UnlockLine As String * 38
End Type
Sub JJ07()
Dim VBAUNLOCK1 As UnlockType1
Dim VBAUNLOCK2 As UnlockType2
Dim VBAUNLOCK3 As UnlockType3
Dim VBAUNLOCK4 As UnlockType4
Dim IID As UnlockType5
Dim cID As UnlockType1
Dim cCMG As UnlockType1
Dim cDPB As UnlockType1
Dim cGC As UnlockType2
Dim c0D0A As UnlockType3
Dim c20 As UnlockType4
Dim c00 As UnlockType4
Dim cFF As UnlockType4
Open ThisWorkbook.Path & "\USER.DAT" For Binary As #1
Get #1, 1, cID
Get #1, 6, cCMG
Get #1, 11, cDPB
Get #1, 16, cGC
Get #1, 20, c0D0A
Get #1, 22, c20
Get #1, 23, c00
Get #1, 24, cFF
Close #1
End Sub
各位老师,我简单的理解:以上代码是以二进制模式打开USER.DAT文件,并把相应的值赋值给自定义变量;请教有没有办法把USER.DAT这个文件去掉,因为USER.DAT文件是固定,直接把相应的值赋值给cID ,cCMG 。。。,不然运行这段代码还必须有USER.DAT文件配合,图片的用HDX打开USER.DAT
得到的
|
|