delphi怎么创建一个文本文件

//创建一个文本文件

procedure TFrmAutomatismBalance.FlatButton3Click(Sender: TObject);

var

TF:TextFile;
  PathStr:string;

begin

 PathStr:=ExtractFilePath(Application.ExeName)+FormatDateTime('yyyy-mm-dd',Now())+'.txt' ;
  AssignFile(Tf,PathStr);
  ReWrite(Tf);
  CloseFile(Tf);

end;

//往文本文件里面写入数据

procedure TFrmAutomatismBalance.FlatButton3Click(Sender: TObject);

var
  TF:TextFile;
  PathStr:string;

begin  

  PathStr:=ExtractFilePath(Application.ExeName) +FormatDateTime('yyyy-mm-dd',Now())+'.txt' ;
      AssignFile(Tf,PathStr);
      Append(Tf);
      WriteLn(Tf,'Creat A TXT');
      Flush(Tf);
      CloseFile(Tf);

end;

上一篇:我的Android手册


下一篇:Android切换页面效果的实现一:WebView+ViewFlipper