使用AHM2000中的一个控件AHMSERIALNO(名字记不清了),它可以设置序列号和试用期。

解决方案 »

  1.   

    TO 月光:
    我可以用UltraEdit对安装前后的注册表对比一下,给你改回去或者改成别的不就又可以用了?
    继续关注!~
      

  2.   

    操作注册表不是最好的
    不过是否可以把第一次运行软件的日期保存在exe文件里啊 
    那样什么人也改不了了
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      Registry;type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
      private
        { Private declarations }
        FCount: Integer;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}const
      cValueName = 'MMCount';
      cKeyName = 'MMSystem';
      cUseCount = 2;procedure TForm1.FormCreate(Sender: TObject);
    begin
      with TRegistry.Create do try
        RootKey := HKEY_CURRENT_USER;
        OpenKey('\Software\Microsoft\Windows\CurrentVersion\' + cKeyName, True);
        if ValueExists(cValueName) then
          FCount := ReadInteger(cValueName)
        else FCount := 0;
      finally
        CloseKey;
        Free;
      end;
      if FCount > cUseCount then begin
        ShowMessage('Error!');
        Halt(0);
      end;
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
      Inc(FCount);
      with TRegistry.Create do try
        RootKey := HKEY_CURRENT_USER;
        OpenKey('\Software\Microsoft\Windows\CurrentVersion\' + cKeyName, True);
        WriteInteger(cValueName, FCount);
      finally
        Free;
      end;
    end;end.