使用手册
Delphi 实例这个实例使用 Enigma API 函数 EP_TrialExecutions 来获取总运行次数和剩余次数。如果剩余次数少于总次数的一半,将会显示提示消息。 program test; {$APPTYPE CONSOLE} uses Windows, SysUtils, enigma_ide in 'include\enigma_ide.pas'; var Total, Left : word; sMessage : string; begin // This is test application of trial Enigma API functions // If the function succeed then it returns true // If the function failed then // 1. the trial limit on executions number was not set before protection // 2. here is unexpected error if EP_TrialExecutions(Total, Left) then begin if Left = 0 then begin MessageBox(0, 'Your trial period has over!', 'Test application', 0); end else begin if (Total div Left) >= 2 then sMessage := 'You have left more then half executions of your trial! period'; sMessage := sMessage + format('You have left %d from %d days of your trial period!', [Left, Total]); MessageBox(0, PChar(sMessage), 'Test application', 0); end; end; // You may also use EP_TrialDays and EP_TrialExpirationDate // functions to control trial period end. |