一个简单的加密算法(注册码)

来源:互联网 发布:美的售后软件 编辑:程序博客网 时间:2024/05/16 23:49

#pragmahdrstop

//---------------------------------------------------------------------------

#include"Function.h"

//---------------------------------------------------------------------------

#pragmapackage(smart_init)

//---------------------------------------------------------------------------

#define PLUS100039544

#defineMULTIPLY 58983

//15168 Keyfor xxxxx

//SNScole:100000000-999999999

//SN=100039544+i*58983(0<=i<15258)

//RedWallPID=12

//Date:2003-03-27

//Sn ="isoft" + int + "dnaps";

//e.g.  SN=isoft311965463dnaps

 

bool__declspec(dllexport) IS_Author(AnsiString Version,AnsiString Sn)

{

    bool Result=false;   if(Sn.Length()==19&&Sn.SubString(1,5)=="isoft"&&Sn.SubString(15,5)=="dnaps")

    {

        int tmp=Sn.SubString(6,9).ToInt()-PLUS;

        tmp=tmp%MULTIPLY;

        if(tmp==0)

            Result=true;

    }   

   return Result;

}

原创粉丝点击