EP_TrialExpirationDate
EP_TrialExpirationDate 函数用来取得试用期的过期日期。试用期的过期日期需要在 试用控制 - 过期日期 面板中定义。参看 EP_TrialExpirationDateEx 函数。
参数
- Year - 试用期过期的年份;
- Month - 试用期过期的月份;
- Day - 试用期过期的日期;
返回值
如果函数成功执行,返回值为 1 ,否则为 0 。
备注
在以下情况函数不会执行成功:
如果用户的计算机有多个登录用户,试用信息对每个用户均不同。
定义
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall BOOL EP_TrialExpirationDate( int* Year, int* Month, int* Day );
Show/Hide Delphi function definition
function EP_TrialExpirationDate( var Year, Month, Day : integer) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_TrialExpirationDate Lib "enigma_ide.dll" (ByRef Year As Long, ByRef Month As Long, ByRef Day As Long) As Byte
Show/Hide C# (.NET) function definition
public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool EP_TrialExpirationDate(ref Int32 Year, ref Int32 Month, ref Int32 Day);
}
实例
Show/Hide Delphi function example
uses
DateUtils,
Math,
enigma_ide;
procedure CheckTrial;
var
wYear : integer;
wMonth : integer;
wDay : integer;
begin
if EP_TrialExpirationDate(wYear, wMonth, wDay) then
begin
if not CompareDate(EncodeDate(wYear, wMonth, wDay), Now) = LessThanValue then
begin
MessageBox(0, 'Your trial period has expired! You must purchase application to take effect!', 'Application', 0);
ExitProcess(0);
end;
end else
MessageBox(0, 'I seem that you have forgotten to define date trial limit in Enigma!', 'Application', 0);
end;
可以在安装文件夹下 Examples\Trial 查看函数使用实例。