对二进制文件的读取

nannet 2001-05-10 12:03:00
用VB如何打开二进制文件,顺序文件的可以打开,但二进制文件呢?
...全文
90 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ttyp 2001-05-10
  • 打赏
  • 举报
回复
Private Sub Command2_Click()
Dim File2 As Integer
Dim inbuf2 as byte
File2 = FreeFile
Open "d:\setup2\lnac.dbf" For Binary Access Read As File2


Do While Not EOF(File2)
Get #File2, , inbuf2
Print chr(inbuf2)
Loop

End Sub
nannet 2001-05-10
  • 打赏
  • 举报
回复

能帮我分析一下吗?????

Private Sub Command2_Click()
Dim File2 As Integer
Dim inbuf2 As String
File2 = FreeFile
Open "d:\setup2\lnac.dbf" For Binary Access Write As File2


Do While Not EOF(File2)
Get #File2, , inbuf2
Print inbuf2
Loop

End Sub
nannet 2001-05-10
  • 打赏
  • 举报
回复
怎么用了这个方法我的程序死了???
ttyp 2001-05-10
  • 打赏
  • 举报
回复
下列代码以只允许写操作的二进制方式打开文件。

Open "TESTFILE" For Binary Access Write As #1

下列代码以只允许读的二进制方式打开文件;其他过程不可以读该文件。

Open "TESTFILE" For Binary Access Read Lock Read As
cqq_chen 2001-05-10
  • 打赏
  • 举报
回复
还是用OPEN函数,详细用法查MSDN。
ttyp 2001-05-10
  • 打赏
  • 举报
回复
收到,谢谢
nannet 2001-05-10
  • 打赏
  • 举报
回复
我这个新手能得到帮助很高兴分收到了吗?

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧