Public Function ByteLoad(ByVal N As String) As Byte() '读取文件二进制数据
On Error GoTo Over
Dim Dat() As Byte, FileSize As Long '二进制数组,文件长度
FileSize = FileLen(N) '获取文件长度
ReDim Dat(FileSize - 1) As Byte '定义二进制数组长度
Open N For Binary As #65 '打开读取
Get #65, , Dat
Close
ByteLoad = Dat '赋值
Over:
End Function