易截截图软件、单文件、免安装、纯绿色、仅160KB

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 编写的com 对象 用delphi 的调用实例

delphi 编写的com 对象 用delphi 的调用实例
COM 对象与 前一篇文章的 PHP调用的COM为同一个对象,故不例出COM.
procedure TForm1.Button4Click(Sender: TObject);
var
  myCounter, mReturn: variant;
begin
  myCounter := CreateOleObject('abc.myxml');
  mReturn := myCounter.xml;
 &nbs ......

Delphi in a Unicode World Part II

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.
//
 & ......

XP环境下在Delphi中调试COM+组件

现在应用系统流行用B/S开发,早几年前可是C/S的天下呢,我现在做的某航空公司货运结算维护工作,其系统就是利用Delphi开发的C/S应用程序!在日常的维护工作中,难免要对已经做好的COM+组件进行调试,以查看具体的处理逻辑!本文就是介绍在WindowsXP环境下如何在Delphi中调试COM+组件!
第一步:记录下你希望调试的COM+组件 ......

delphi技巧记录


#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. ......

delphi 编译后出现iphist.dat 文件

 很奇怪,昨天在编译程序的时候,出现过,iphist.dat 文件。每次执行都出现,仔细查看代码,什么也没有啊!后来在网站找到原因:
 使用了IPWatch 控件的
一般产生这个文件是因为使用了indy的 TIdIPWatch 控件
该控件有个
ip历史的功能。
historyfilename指定的是保存ip历史记录的文件名,默认是iphist.Dat ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号