function SplitFile(const FileName: string; Size: Cardinal): Boolean; var fStream: TFileStream; {原始文件} toStream: TMemoryStream; {分文件} p,i: Integer; {p 记录当前指针位置; i 记录这是第几个分的文件} begin Result := False;
// Size := Size * 1024; {把大小的单位转换为字节}
fStream := TFileStream.Create(FileName, fmOpenRead); p := 0; i := 1;
toStream := TMemoryStream.Create;
while p < fStream.Size do begin toStream.Clear; {清空上次数据} fStream.Position := p; {放好指针位置}
if ( fStream.Size-p < Size ) then Size := fStream.Size-p; {最后一个时, 有多少算多少}