Registriert seit: 7. Jun 2008
708 Beiträge
Delphi 10.2 Tokyo Professional
|
Re: Blob: Filestream und Zusatzinformation
25. Mär 2009, 15:00
Delphi-Quellcode:
var
Strm1, Strm2: TMemoryStream;
begin
Strm1 := TMemoryStream.Create;
Strm2 := TMemoryStream.Create;
try
Strm2.LoadFromFile ('C:\irgendeinedatei.xyz');
Strm1.Write (LengthOfFileName, sizeof (Integer));
Strm1.Write (FileName[1], LengthOfFileName);
Strm1.Write (Strm2.Size, sizeof (Integer));
Strm1.Write (Strm2.Buffer^, Strm2.Size));
Blob.CopyFrom(Strm1, Strm1.Size);
finally
FreeAndNil (Strm1);
FreeAndNil (Strm2);
end;
end;
Ungetestet ...
|
|
Zitat
|