doKey() public method

public doKey ( int timeLeft, int useMachineCode ) : object
timeLeft int For instance, 30 days
useMachineCode int Lock a serial key to a specific machine, given its "machine code". Should be 5 digits long.
return object
Beispiel #1
0
 static void Test1()
 {
     //1.创建key生成对象
     var CreateAKey = new Generate();
     //2.设置密钥
     CreateAKey.secretPhase = "testdemo";
     //3.生成key,30天时间限制
     var key1 = CreateAKey.doKey(30);
     //4.还可以设置机器码以及设置起始日期,机器码是1个5位Int数
     //机器码要客户在自己电脑上计算后获得,我这里是随便填一个
     var key2 = CreateAKey.doKey(30, 61123);
     Console.WriteLine("Key 1 :"+key1);
     Console.WriteLine("Key 2 :"+key2);
 }
Beispiel #2
0
 static void Test3()
 {
     //配置对象
     SerialKeyConfiguration skc = new SerialKeyConfiguration();
     //生成key对象
     Generate CreateAKey = new Generate(skc);
     //
     string trialKey = CreateAKey.doKey(30); //试用版30天期限
     //创建1个有时间限制的试用版
     skc.Features = new bool[8] { true, false, false, false,false, false,false ,false };
     // 当然这里的版本可以自定义,只要你自己认识就行了
 }
Beispiel #3
0
        public string GetNewCDKey(int daysLeft, DateTime creationDate, int machineCode, string secretPhase, bool foreverWork = false)
        {
            SKGL.SerialKeyConfiguration skc = new SKGL.SerialKeyConfiguration();
            if (foreverWork == true)
            {
                skc.Features[0] = true;
            }
            SKGL.Generate generate = new SKGL.Generate(skc);
            generate.secretPhase = secretPhase;

            return(generate.doKey(daysLeft, creationDate, machineCode));
        }