|
Protection API - SDP_GetKeyExpirationDate
SDP_GetKeyExpirationDate
The SDP_GetKeyExpirationDate function is used to read in expiration
date of a license key.
For C++:
int SDP_GetKeyExpirationDate(
LPSYSTEMTIME lpSystemTime // expiration date ); For Delphi:
function SDP_GetKeyExpirationDate( lpSystemTime :PSystemTime // expiration date
): Integer;
|
Parameters
- lpSystemTime
- [out] Pointer to a SYSTEMTIME structure to receive expiration date
of a license key.
Return Values
- If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
- If there is no valid license key found in user's computer, the return
value is zero.
Example
- for C/C++
- #include "SDProtector.h"
//...
void GetExpirationDate()
{
SYSTEMTIME ExpirationDate;
char szInfo[256];
if(SDP_GetKeyExpirationDate(&ExpirationDate))
{
//If succeeded
sprintf(szInfo,"License key will be expired on %4d,%02d,%02d",
ExpirationDate.wYear,ExpirationDate.wMonth,ExpirationDate.wDay);
::MessageBox(NULL,szInfo,"Expiration Info",MB_ICONINFORMATION); - }
else
{
//if failed
::MessageBox(NULL,"This an unregistered version","Error",MB_ICONINFORMATION);
}
-
}
- for Delphi
- procedure GetExpirationDate;
var ExpirationDate: SYSTEMTIME; szInfo: String;
begin
if SDP_GetKeyExpirationDate(@ExpirationDate) = 1 then
begin
szInfo=format('License key will be expired on %4d,%02d,%02d', [ExpirationDate.wYear,ExpirationDate.wMonth,ExpirationDate.wDay]);
MessageBox(0,@szInfo[1],'Expiration Info', MB_ICONINFORMATION);
end
else
MessageBox(0,'This an unregistered version','Error',MB_ICONINFORMATION);
end;
Sample application is located in \Examples\Delphi\API\ and \Examples\VC\API\
directory.
|