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 用idhttp打开网页或下载文件时如何显示进度

Delphi idhttp中get 图像链接通过memorystream加载 image控件显示

Delphi 查看指定进程占用端口

monthdays:给出一个月的天数

Delphi winapi: loadstring - 从资源中载入字符串

processid, process handle, window handle 之间的互相转换

Delphi winsoft comport for android usb

Delphi idhttp post request

Delphi 创建一个大小不可改变的窗体,通用模板

Delphi+sql数据库增加,删除,修改,查询操作

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



打赏

取消

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

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

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

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

评论

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