Delphi 创建目录及写日志文件
Delphi 创建目录及写日志文件
var
TF: TextFile;
LogFile: string;
txt :string;
sysDir:string;
//创建按钮
procedure TForm1.Button1Click(Sender: TObject);
begin
sysDir:=extractfilepath(application.ExeName );
if not directoryexists(sysdir+'log\') then
createdir(sysdir+'log\');
logfile:=sysdir+'log\'+formatdatetime('yyyymmdd',now)+'.txt';
end;
//写日志按钮
procedure TForm1.Button2Click(Sender: TObject);
begin
//assignfile(logfile,'log.txt');
AssignFile(tf,logfile);
if fileexists(logfile) then
append(tf)
else
rewrite(tf);
writeln(tf,'123');
closefile(tf);
end;
相关文档:
---
Delphi in a Unicode World Part I: What is Unicode, Why do you need
it, and How do you work with it in Delphi?
By: Nick
Hodges
原文链接:http://dn.codegear.com/article/38437
Abstract: This article discusses Unicode, how Delphi developers
can benefit from using Unicode, and ho ......
Delphi in a Unicode World Part II: New RTL Features and
Classes to Support Unicode
By: Nick
Hodges
原文链接:http://dn.codegear.com/article/38498
Abstract: This article will cover the new features of the Tiburon
Runtime Library that will help handle Unicode strings.
//
& ......
原作者:光明兄弟
最近我正在研究ActiveX技术。我使用Delphi 7创建了一个具有ActiveForm的ActiveX控件应用程序。这个控件产生一个.OCX文件。现在,我需要把这个控件部署在服务器端,在用户浏览网页并选择安装这个控件的时候,用户的IE才会下载、安装并显示这个控件。
但是我的控件必须作数字签名以后,IE才会下载安装。 ......
好久没写BLOG了,送上一份原创的DELPHI版MP3切割,splitMp3为切割函数,支持按时间切割和按大小切割。望大家支持。
参考VC的资料编写的MP3切割DELPHI版单元.
unit UnitMp3DataUtil;
{
MP3 Cut Unit.
@author Jim Wu
2009-08
}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, ......
#13回车换行
将form2内容加入到form1列表框:在form2里:form1.listbox1.items.add(edit1.text)
listbox1.items.loadfromfile('chinese.txt')将chinese.txt文件内容载入列表框中。但前提是要整个窗体创建时候加载导入,双击整个窗体procedure TForm1.FormCreate(Sender: TObject)
listbox1.items.savetofile('chinese. ......