做了一个小软件,快完工了
我想学习一下如何给自己的软件加密,
不知道用哪种方法才好呢?
打算用限制时间使用期限的方式,可是不知道怎么写代码,哪位仁兄作过,教我呀,先谢了先!BTW:看过挺多软件用的是时间限制,有些到期后,我修改年月又可以用了,有些就不行,不知道是什么道理。大家一般用什么方法来加密自己的软件呢,多多赐教呀!

解决方案 »

  1.   

    写注册表呗。
    unit regApp; interface uses Windows,SysUtils,Registry,forms, Dialogs; type 
    Tlogin = class 
    private 
    public 
    constructor Create; virtual; 
    procedure CheckLogin; 
    end; 
    implementation constructor Tlogin.Create; 
    begin 
    inherited Create; 
    end; procedure Tlogin.CheckLogin; 
    var 
    Reg_id: TDateTime; 
    RegisterTemp: TRegistry; 
    InputStr, Get_id: string; 
    Reg_tag, ClickDok: Boolean; 
    Allow: Integer; 
    begin 
    Allow := 30; //试用期为30天 
    Reg_tag := False; //软件是否到注册期 
    registerTemp := TRegistry.Create; //准备使用注册表 
    with registerTemp do 
    begin 
    RootKey := HKEY_LOCAL_MACHINE; //存放 
    if OpenKey(''Software\Microsoft\Windows\CurrentSowft\tag'', True) then // 建一目录,存放标志值 
    begin 
    if ValueExists(''DateTag'') then begin //用DateTag的值作为标志 
    Reg_id := ReadDate(''DateTag''); //读出标志值 
    if (Reg_id <> 0) and (Now - Reg_id > Allow) then //允许使用的时间到 
    Reg_tag := True; 
    end 
    else 
    WriteDateTime(''DateTag'', Now); //建立标志,并置初始标志值。 
    end; 
    if Reg_tag then begin //要求用户输入注册码 
    ClickDok := InputQuery(''您使用的是非注册软件,请输入注册码:'', '' '', inputstr); 
    if ClickDok then begin 
    Get_id := IntToStr(2222); //注册码2 
    if Get_id = InputStr then begin 
    WriteDateTime(''DateTag'', 0); //将标志值置为0,即已注册。 
    CloseKey; 
    Free; 
    end 
    else begin //若输入的注册码错误 
    Application.MessageBox(''注册码错误!请与作者联系!'', ''警告框'', mb_ok); 
    CloseKey; 
    Free; 
    Application.Terminate; 
    end; 
    end 
    else begin //若用户不输入注册码 
    Application.MessageBox(''请与作者联系,使用注册软件!'', ''警告框'', mb_ok); 
    CloseKey; 
    Free; 
    Application.Terminate; 
    end; 
    end; 
    end; 
    end; end.
      

  2.   

    硬狗也不太保险,看到身边一个汇编牛人,用SOFTICE把小日本的一个机器人硬件卡给破了,真TMD爽!
      

  3.   

    我在“http://expert.csdn.net/Expert/topic/2356/2356739.xml?temp=.8981592”中间接的谈了我的看法(硬件识别)?我还想知道“加密狗”大概多少钱一个?“并口”或“USB口”的哪一种好?打狗的步骤又该如何办?
    [email protected]