请问如何在一个文本文件里写如每一条信息,不覆盖前面写入的数据。代码应该怎么写?

解决方案 »

  1.   

    用inifile.writestring()可以实现吗?还是用其它的方法?
      

  2.   

    F1: TextFile;
    if FileExists(你的文件路径) then append(f1);
    Writeln(F1, TempStr1);
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      MyTxt : Textfile;
    begin
      if OpenDialog1.Execute then
      begin
        try
          AssignFile(MyTxt,OpenDialog1.FileName);
          Append(MyTxt);
          writeln(MyTxt,'YUN LOVE RUI');
        finally
          CloseFile(MyTxt);
        end;
      end;end;