delphi 方便的文本文件操作(TEXT)


本文整理自网络,侵删。

 
FText: Text;//只能定义为成员或全局
AssignFile( FText, edt1.Text );//打开文件
  Rewrite( FText );//只能一行一行的写
  Writeln( FText, 'aaa');
  Writeln( FText, 'aaa');
  Writeln( FText, 'aaa');
  Writeln( FText, 'aaa');
  Writeln( FText, 'aaa');
  CloseFile( FText );//关闭也就是保存
  s: string;
  Reset( FText );
  mmo1.Clear;
  while not Eof(FText) do
  begin
    Readln( FText, s );
    mmo1.Lines.Add(s);
  end;

相关阅读 >>

Delphi 通过idhttp实现登录验证

Delphi shellexecute最简单的结束进程代码

Delphi几个进制相关的代码(hextoint、hextoasc)

Delphi ascii 码对照表

Delphi url取得文件名

Delphi调节图片亮度、色彩和饱和度的代码

Delphi用内存流方式获取页面验证码图片

Delphi twebbrowser出现 method pastehtml not supported by automation object 解决方法

Delphi serial number of an usb flash drive 获取u盘硬件序列号

Delphi 缓冲文件流-tbufferedfilestream tfilestream 性能测试

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...