我做好的isapi 的dll,在主执行文件main.dll里面加上时间限制的代码,在注册表里
写入了一些时间和次数值 ,调试好后在win98的pws环境里启动主页面 正常,观察注册表
结果也正确,只是将操作系统换为win2000就执行不了,去掉操作注册表的代码就可以了。
本人一时愚昧,望各位尽力帮助!谢谢!代码如下: flag:=false;
ln_useSum:=0;
Datetimetostring(newstring,'yyyy-mm-dd',date()); Registry:=TRegistry.Create;
Registry.RootKey:=HKEY_LOCAL_MACHINE;
registry.OpenKey('\Software\newsoftworkshop\yourdog\nmsrd1', True); lc_secstr:=datetostr(date()-521); lc_readstr:=lc_secstr; if Registry.valueExists('nmsrdinitdate') then
begin
lc_readstr:=Registry.ReadString('nmsrdinitdate');
lc_readstr :=datetostr(strtodate(lc_readstr)+521);
flag:=true;
end
else
Registry.WriteString('nmsrdinitdate',lc_secstr); if not Registry.valueExists('nmsrduseSum') then
Registry.WriteString('nmsrduseSum','0');
if (flag) and (comparestr(lc_readstr,newstring)<>0) then
begin
ln_useSum:=strtoint(Registry.ReadString('nmsrduseSum'));
ln_useSum:= ln_useSum +1;
Registry.WriteString('nmsrduseSum',inttostr(ln_useSum));
lc_secstr:=datetostr(date()-521);
Registry.WriteString('nmsrdinitdate',lc_secstr);
end; Registry.Free;
if ln_useSum >4 then
response.content:='对不起,系统使用时间(五天)已结束!请尊重软件人员的劳动。'
+'<br>'+'请向软件提供商索取付费后的执行文件!'
else
begin if trim(getuserID(query2,request))='' then
response.Content:=first.Content
else
response.Content:=logon.content; end;
写入了一些时间和次数值 ,调试好后在win98的pws环境里启动主页面 正常,观察注册表
结果也正确,只是将操作系统换为win2000就执行不了,去掉操作注册表的代码就可以了。
本人一时愚昧,望各位尽力帮助!谢谢!代码如下: flag:=false;
ln_useSum:=0;
Datetimetostring(newstring,'yyyy-mm-dd',date()); Registry:=TRegistry.Create;
Registry.RootKey:=HKEY_LOCAL_MACHINE;
registry.OpenKey('\Software\newsoftworkshop\yourdog\nmsrd1', True); lc_secstr:=datetostr(date()-521); lc_readstr:=lc_secstr; if Registry.valueExists('nmsrdinitdate') then
begin
lc_readstr:=Registry.ReadString('nmsrdinitdate');
lc_readstr :=datetostr(strtodate(lc_readstr)+521);
flag:=true;
end
else
Registry.WriteString('nmsrdinitdate',lc_secstr); if not Registry.valueExists('nmsrduseSum') then
Registry.WriteString('nmsrduseSum','0');
if (flag) and (comparestr(lc_readstr,newstring)<>0) then
begin
ln_useSum:=strtoint(Registry.ReadString('nmsrduseSum'));
ln_useSum:= ln_useSum +1;
Registry.WriteString('nmsrduseSum',inttostr(ln_useSum));
lc_secstr:=datetostr(date()-521);
Registry.WriteString('nmsrdinitdate',lc_secstr);
end; Registry.Free;
if ln_useSum >4 then
response.content:='对不起,系统使用时间(五天)已结束!请尊重软件人员的劳动。'
+'<br>'+'请向软件提供商索取付费后的执行文件!'
else
begin if trim(getuserID(query2,request))='' then
response.Content:=first.Content
else
response.Content:=logon.content; end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货