把窗体读到内存流然后转为text

procedure TfrmBiaoBLBWH.Button1Click(Sender: TObject);
var
ABinary,AText:TMemoryStream;
begin
inherited;
ABinary:=TMemoryStream.Create;
ABinary.WriteComponent(Self);
ABinary.Position:=0;
AText:=TMemoryStream.Create;
ObjectBinaryToText(ABinary,AText);
AText.Position:=0;
ShowMessage(LoadTextW(AText));
FreeAndNil(AText);
FreeAndNil(ABinary);
end;

posted @ 2017-09-14 08:59  绿水青山777  阅读(156)  评论(0编辑  收藏  举报