delphi save .dfm to .txt

procedure TForm2.saveDfm;
var
  inStream,outStream:TMemoryStream;
begin
   inStream:=TMemoryStream.Create;
   outStream:=TMemoryStream.Create;
   try
      inStream.WriteComponent(self);
      inStream.Position:=0;
      ObjectBinaryToText(inStream,outStream);
      outStream.Position:=0;
      outStream.SaveToFile('c.txt');
   finally
     FreeAndNil(inStream);
     FreeAndNil(outStream);
   end;
end;
posted @ 2020-01-09 18:42  创新创造学习整合套路  阅读(177)  评论(0编辑  收藏  举报