delphi写文本文件


本文整理自网络,侵删。

 procedure TForm1.Button1Click(Sender: TObject);
var
LogFile: TextFile;
begin
if not FileExists('c:\Log1.txt') then
begin
AssignFile(LogFile, 'c:\Log1.txt');
Rewrite(LogFile);
CloseFile(LogFile); //关闭时自动保存文件
end;

AssignFile(LogFile, 'c:\Log1.txt');
Append(LogFile);

writeln(LogFile);
writeln(LogFile, '*********End**********');
writeln(LogFile);
writeln(LogFile, '********begin*********');
Write(LogFile, 'Begin the same line');
Write(LogFile, '//the same line');
CloseFile(LogFile);
end;

相关阅读 >>

Delphi的窗体文件(dfm)文件中的汉字提取出来?

Delphi2010安装twordapplication控件

Delphi根据进程id获取进程路径

Delphi inttostransi

Delphi 详解variant 的相关函数

floattostr问题 保留小数位

进程防杀Delphi版(dll部分)

Delphi 自我拷贝复制

Delphi urldownloadtofile 支持进度条

Delphi trayicon控件,如何实现窗口最小化的时候到系统托盘?

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



打赏

取消

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

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

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

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

评论

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

    暂无评论...