在fastNet中提供NmStrmserv, NmStrm
NmStrm
MyFStream := TFileStream.Create(FileName, fmOpenRead);
try
NMStrm1.PostIt(MyFStream);
finally
MyFStream.Free;
end;
NmStrmServ Msg事件
procedure TForm1.NMStrmServ1MSG(Sender: TComponent; const sFrom: String;
strm: TStream);
var
MyFStream: TFileStream;
begin
If FileExists('./tmp.bmp') then DeleteFile('./tmp.bmp');
MyFStream := TFileStream.Create('./tmp.bmp', fmCreate);
try
MyFStream.CopyFrom(strm, strm.size);
finally
MYFStream.Free;
end;
end;
详细请参考delphi Demos/fastnet/strm