![]() |
#2
xzlxzlxzl2018-04-02 20:00
|
文本文件(temp.txt)里的内容如下:
02 6D 00 00
02 6D 00 00
02 6D 00 00
02 6D 00 00
02 6D 00 00
02 6D 00 00
02 6D 00 00
.
.
.
.
.
.
数据文件(001.OB3635A-HSA002-1)里的内容为十六进制数据,
现在想把文本文件里的内容(已是16进制数据)逐条添加到数据文件最后,不知道这段程序怎么写。
我学着写文本文件方式写了一段,运行后好像不对,数据文件(001.OB3635A-HSA002-1)尾部并没有增加文本文件(temp2.txt)里的内容。

Private Sub Command2_Click()
Dim tmp2
Open Dir1.Path & "\temp2.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, temp1
tmp2 = Split(temp1, " ")
Open Dir1.Path & "001.OB3635A-HSA002-1" For Binary As #2
Put #2, , tmp2(0)
Put #2, , tmp2(1)
Put #2, , tmp2(2)
Put #2, , tmp2(3)
Close #2
Loop
Close #1
End Sub
Dim tmp2
Open Dir1.Path & "\temp2.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, temp1
tmp2 = Split(temp1, " ")
Open Dir1.Path & "001.OB3635A-HSA002-1" For Binary As #2
Put #2, , tmp2(0)
Put #2, , tmp2(1)
Put #2, , tmp2(2)
Put #2, , tmp2(3)
Close #2
Loop
Close #1
End Sub
恳求各位大大给段程序。
只有本站会员才能查看附件,请 登录