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;