Partager via


Generating the Rights

banner art

Previous Next

Generating the Rights

Use the WMRMRights object to specify the rights you want to enable for your Windows Media files, and then set these rights in the WMRMLicGen object. The following example provides you with the Visual Basic Scripting Edition (VBScript) code you can use according to your rights scenario.

VBScript Example

' Declare variables.
Dim RightsObj        ' WMRMRights object
Dim RestrictObj      ' WMRMRestrictions object
Dim LicenseObj       ' WMRMLicGen object
Dim RightsString     ' Rights string for the license

' Set the rights.
Set RightsObj = Server.CreateObject("WMRMObjs.WMRMRights")
RightsObj.Playcount = 2
RightsObj.AllowCopy = True
RightsObj.CopyCount = 5
RightsObj.AllowCollaborativePlay = False
RightsObj.AllowBackupRestore = False
RightsObj.AllowPlaylistBurn = True
RightsObj.MaxPlaylistBurnCount = 5
RightsObj.PlaylistBurnTrackCount = 15
RightsObj.MinimumClientSDKSecurity = 3000
RightsObj.MinimumSecurityLevel = 1000
RightsObj.GracePeriod = 24

RightsObj.ExpirationDate = "#20051231Z#"
RightsObj.DeleteOnClockRollback = False
RightsObj.DisableOnClockRollback = True

' Set copy restrictions.
Set RestrictObj = Server.CreateObject("WMRMObjs.WMRMRestrictions")
Call RestrictObj.AddRestriction(6, 400)
RightsObj.CopyRestrictions = RestrictObj.GetRestrictions

' Get the rights string.
RightsString = RightsObj.GetAllRights

' Set the rights into the license.
Set LicenseObj = Server.CreateObject("WMRMObjs.WMRMlicgen")
LicenseObj.Rights = RightsString

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.