读取一个二进制文件到一个数组中 [英] Read a binary file into an array
本文介绍了读取一个二进制文件到一个数组中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一种方式,尽管你被限制在2 GB左右的文件。
Dim fileNum As Integer
Dim bytes( )作为字节
fileNum = FreeFile
打开C:\test.bin作为二进制文件FileNum
ReDim字节(LOF(fileNum) - 1)
获取fileNum,字节
关闭fileNum
What's the fastest way (using VB6) to read an entire, large, binary file into an array?
解决方案
Here's one way, although you are limited to files around 2 GB in size.
Dim fileNum As Integer
Dim bytes() As Byte
fileNum = FreeFile
Open "C:\test.bin" For Binary As fileNum
ReDim bytes(LOF(fileNum) - 1)
Get fileNum, , bytes
Close fileNum
这篇关于读取一个二进制文件到一个数组中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文