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 dll 实例 与 dll窗体实例
本动态链接库方法有
Min,Max,SynAPP,ShowForm,showmyform
dll工程文件
Library Project1;
uses
dllUnit1 in 'dllUnit1.pas' {Form1};
function Min(X, Y: Integer): Integer; export;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): ......
delphi 注册 com 对象的方法
procedure TForm1.Button3Click(Sender: TObject);
var
Sd: TSecurityDescriptor;
begin
InitializeSecurityDescriptor(@Sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(@Sd, true, Nil, false);
RegSe ......
现在应用系统流行用B/S开发,早几年前可是C/S的天下呢,我现在做的某航空公司货运结算维护工作,其系统就是利用Delphi开发的C/S应用程序!在日常的维护工作中,难免要对已经做好的COM+组件进行调试,以查看具体的处理逻辑!本文就是介绍在WindowsXP环境下如何在Delphi中调试COM+组件!
第一步:记录下你希望调试的COM+组件 ......
很奇怪,昨天在编译程序的时候,出现过,iphist.dat 文件。每次执行都出现,仔细查看代码,什么也没有啊!后来在网站找到原因:
使用了IPWatch 控件的
一般产生这个文件是因为使用了indy的 TIdIPWatch 控件
该控件有个
ip历史的功能。
historyfilename指定的是保存ip历史记录的文件名,默认是iphist.Dat
......
Delphi中Format字符串说明
function Format(const Format: string; const Args: array of const):
string;
Format字符串说明:
"%" [index ":"] ["-"] [width] ["." prec] type
(1)
格式化字符串必须以%开头
(2) [index ":"]
索引指的是Args参数列表中要显示的每一项的序号。比如:Args是
......