J
jbas
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button31Click(Sender: TObject);
var
stream3:tfilestream;
stream4:tfilestream;
myfilesize:integer;
my4:integer;
ls:Integer;
begin
stream3:=tfilestream.Create('d:/project2.exe',fmopenread);
stream4:=tfilestream.Create('d:/stream1.dat',fmopenwrite);
myfileSize:=stream3.Size+sizeof(myfilesize);
my4:=stream4.Size;
stream4.seek(0,0);
stream4.readbuffer(ls,sizeof(ls));//把steam4的原内容读入ls。
stream4.seek(0,0);
stream4.CopyFrom(stream3,0);//把stream3的内容读入stream4的开始;
stream4.WriteBuffer(ls,sizeof(ls));//把ls(即stream4的原内容)写入stream4的末尾;
stream3.Free;
stream4.Free;
end;
不知我的思路对吗?但总不行,不是写入在末尾,就是没写入。请高手帮忙了!
var
stream3:tfilestream;
stream4:tfilestream;
myfilesize:integer;
my4:integer;
ls:Integer;
begin
stream3:=tfilestream.Create('d:/project2.exe',fmopenread);
stream4:=tfilestream.Create('d:/stream1.dat',fmopenwrite);
myfileSize:=stream3.Size+sizeof(myfilesize);
my4:=stream4.Size;
stream4.seek(0,0);
stream4.readbuffer(ls,sizeof(ls));//把steam4的原内容读入ls。
stream4.seek(0,0);
stream4.CopyFrom(stream3,0);//把stream3的内容读入stream4的开始;
stream4.WriteBuffer(ls,sizeof(ls));//把ls(即stream4的原内容)写入stream4的末尾;
stream3.Free;
stream4.Free;
end;
不知我的思路对吗?但总不行,不是写入在末尾,就是没写入。请高手帮忙了!