Windows Media Rights Manager SDK banner art

WMRMRights.ExpirationOnStore

The ExpirationOnStore property specifies and retrieves the number of hours that a license is valid, beginning when the license is first stored on a consumer's computer.

Syntax

WMRMRights.ExpirationOnStore = DWORD
DWORD = WMRMRights.ExpirationOnStore

Parameters

This property takes no parameters.

Return Values

When getting the value, this property returns a DWORD specifying the number of hours for which a license is valid, beginning when it is first stored on the consumer's computer. If it fails, it returns E_FAIL.

Remarks

By default, this property is not set and the license does not expire.

This property removes the necessity for the script to perform Greenwich mean time-based date computations.

Example Code

' Before you can issue a license, you must specify the consumer's
' rights and set them in the WMRMLicGen object.

' Declare objects.
    Dim sRights
    Dim RightsObj
    Dim LicGenObj

' Create objects.
    Set RightsObj = Server.CreateObject("Wmrmobjs.WMRMRights")
    Set LicGenObj = Server.CreateObject("Wmrmobjs.WMRMLicGen")

' Reset the WMRMRights object.
    RightsObj.Reset()

' Specify the rights that will be granted to the consumer.
    RightsObj.AllowBackupRestore = False
    RightsObj.AllowPlay = True

' Set the license to expire three days after the license is stored.
    RightsObj.ExpirationOnStore = 72
    RightsObj.DisableOnClockRollback = True

' Retrieve the string containing the rights.
    sRights = RightsObj.GetAllRights()

' Set the rights in the license generator.
    LicGenObj.Rights = sRights

' Continue the license issuing process.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also