其他分享
首页 > 其他分享> > delphi save .dfm to .txt

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;

标签:FreeAndNil,TMemoryStream,delphi,outStream,dfm,Create,Position,txt,inStream
来源: https://www.cnblogs.com/tobetterlife/p/12173002.html