【发布时间】:2014-12-24 02:37:37
【问题描述】:
您好,我正在尝试将拆分文件重新合并在一起。我有这个代码工作,但它非常缓慢。有什么想法可以加快速度吗?每个文件块最多可以包含 5mb 个块,并且可以有 100 个或更多块可以重新组合在一起。我将块文件路径“mergeFileNameArray”的数组以及新合并文件的“文件名”传递给它。
非常感谢!
Dim STo As System.IO.Stream = System.IO.File.Open _ (filename, _ System.IO.FileMode.Create, _ System.IO.FileAccess.Write) Dim BW As New System.IO.BinaryWriter(STo) For Each F In mergeFileNameArray Dim STi As System.IO.Stream = System.IO.File.Open _ (F, _ System.IO.FileMode.Open, _ System.IO.FileAccess.Read) Dim BR As New System.IO.BinaryReader(STi) Do Until (BR.BaseStream.Position = BR.BaseStream.Length) BW.Write(BR.ReadByte) Loop BR.Close() Next BW.Close()
【问题讨论】: