在线求助,文件读入字节数组时内存溢出问题。
of123 2003-11-05 11:38:18 调用一个过程,在过程中用一个数组读入文件内容。当读过几个文件后,再读一个几M的大文件,出现内存溢出错误。先读大文件则正常执行。似乎是数组没有释放,为什么?怎么办?
Dim Filenr As Integer
Dim ByteArray() As Byte
'Open the source file and read the content
'into a bytearray
Filenr = FreeFile
Open SourceFile For Binary As #Filenr
ReDim ByteArray(0 To LOF(Filenr) - 1)
Get #Filenr, , ByteArray()
Close #Filenr