Option Explicit
Dim DevicePath As String
Private Sub ccXPButton1_Click()
Dim Ret As Integer
Dim outstring As String
Dim mylen As Long
mylen=511
Open "C:\mydog.bin" For Output As #1
outstring = Space(mylen)
Ret = YReadString(outstring, 0, mylen, "AAAAAAAA", "BBBBBBBB", DevicePath)
If Ret <> 0 Then
MsgBox "读取数据错误!"
Else
Print #1, outstring
MsgBox "成功读取数据!"
Close #1
End If
End Sub
Private Sub Form_Load()
DevicePath = Space$(260)
If FindPort(0, DevicePath) <> 0 Then MsgBox "未找到加密锁!"
Dim ID1, ID2 As Long
If GetID(ID1, ID2, DevicePath) <> 0 Then Text5.Text = “锁去哪里了?": Exit Sub
Text5.Text = Hex(ID1) & Hex(ID2)
Dim Version As Integer
If NT_GetIDVersion(Version, DevicePath) <> 0 Then Text6.Text = “返回版本号错误!": Exit Sub
Text6.Text = Version
End Sub
工具下载: 域天读锁工具.rar