我想将2个EXE文件通过内存流添加在一起,生成一个新的EXE文件。怎么弄都没通过。请老师帮忙看看!
var
File1,File2,NewFile:string;
SourceMem,TargetMem:TMemoryStream;
mybuf:array[0..32767] of Char;
begin
SourceMem:=TMemoryStream.Create;
TargetMem:=TMemoryStream.Create;
TargetMem.LoadFromFile(File1);
SourceMem.LoadFromFile(File2);
SourceMem.read(mybuf,SourceMem.Size);
TargetMem.Seek(0,2);//从尾部添加
TargetMem.Write(mybuf,SourceMem.Size);
TargetMem.SaveToFile(NewFile);
SourceMem.Free;
TargetMem.Free;
end;
回复 更多评论