procedure Tmain_form.FormCreate(Sender: TObject);
var
registrytemp:tregistry;
curdate:tdatetime;
bootkey:integer;
begin
registrytemp:=tregistry.Create;
with registrYtemp do
begin
bootkey:=(HKEY_LOCAL_MACHINE);
if openkey('phs_ver1\main.exe',true) then
begin
if readbool('runned') then
begin
curdate:=date;
begin
if (curdate-readtime('lastruntime')>=readinteger('durtation')) then
begin
showmessage('试用期已过');
exit;
end
else
begin
deletekey('lastruntime');
writetime('lastruntime',date);
self.Caption:='小灵通分析软件测试版,还剩:'+datetimetostr(curdate-readtime('lastruntime'));
end;
end;
end
else
begin
deletekey('runned');
writebool('runned',true);
writeinteger('durtation',10);
writetime('lastruntime',date);
end;
end
else
begin
showmessage('fails!');
end;
end;
end;
var
registrytemp:tregistry;
curdate:tdatetime;
bootkey:integer;
begin
registrytemp:=tregistry.Create;
with registrYtemp do
begin
bootkey:=(HKEY_LOCAL_MACHINE);
if openkey('phs_ver1\main.exe',true) then
begin
if readbool('runned') then
begin
curdate:=date;
begin
if (curdate-readtime('lastruntime')>=readinteger('durtation')) then
begin
showmessage('试用期已过');
exit;
end
else
begin
deletekey('lastruntime');
writetime('lastruntime',date);
self.Caption:='小灵通分析软件测试版,还剩:'+datetimetostr(curdate-readtime('lastruntime'));
end;
end;
end
else
begin
deletekey('runned');
writebool('runned',true);
writeinteger('durtation',10);
writetime('lastruntime',date);
end;
end
else
begin
showmessage('fails!');
end;
end;
end;
解决方案 »
- 求助,如何把IE里看到的数值发送到memo?
- oolBar的闪烁问题,很奇怪,实在没辙了,高分求教
- 有没有自动登陆论坛发贴的工具???
- 一小段代码(源码)大家帮忙看看
- Delphi6.0支持SQL2000带参数的存储过程吗(通过BDE)吗?delphi4的应用程序如何升级到delphi6?
- 数据库小问题(三层架构的)!!100,急
- 为什么我的分布式程序这么慢?
- 请问哪里有关于三层数据库的原代码,小弟正研究这个。多谢!
- 紧急求助,更新延迟问题,如何解决?Access数据库
- 我是个Delphi新手,使用Delphi6,我发觉一个问题,在调试程序的时候我怎么也找不到停止调试的命令!
- 需要ActiveSkin控件的Crack
- 不结帖的理由!欢迎讨论,兼散分!
读不到RUNNED 怎么办,怎么解决呢,谢谢,我代码是抄来的,谢谢,