Поделиться через


Predelivering Licenses for Netscape 7.1

banner art

Previous Next

Predelivering Licenses for Netscape 7.1

The sample pages predel2.asp and confirm2.asp show how to predeliver licenses using Internet Explorer. However, when using Netscape 7.1, the following changes must be made:

  1. Use JavaScript rather than Visual Basic Scripting Edition (VBScript).

  2. Instantiate the RMGetLicense object using the following code rather than the <OBJECT> tag:

    var netobj = new GeckoActiveXObject("DRM.GetLicense.1");

  3. To enable support for license predelivery, the RMGetLicense object must be added to Netscape's ActiveX controls list file, which is located by default in the file C:\Program Files\Netscape\Netscape\defaults\pref\activex.js on the client computer. This file must be modified by adding the following code to it:

    pref("capability.policy.default.ClassID.CIDA9FC132B-096D-460B-B7D5-1DB0FAE0C062", "AllAccess");

    If the RMGetLicense object is not in this list, the Web-page code hosting it will receive an error about instantiating the object.

The following example code shows modified versions of the sample pages predel2.asp and confirm2.asp, enabling you to predeliver licenses by using Netscape 7.1.

Example Code

' Modified Predel2.asp 
<html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function LicenseDown(){
    var netobj = new GeckoActiveXObject("DRM.GetLicense.1");
    document.predeliver.clientinfo.value = netobj.GetSystemInfo();
    document.predeliver.cid.value = "3";      
    document.predeliver.submit();
}
//-->
</SCRIPT>

<body>
<P><STRONG>
<FONT size=6 color=#7cfc00>
</FONT><font color="#0000FF" size="5">Sample 1: Predelivering a 9 Series license</font></STRONG></P>
<P><font>The best song ever will soon be available! </font>Buy it now!</P>
<font size="5">
<form name="predeliver" action="prelicgen.asp?predeliver=1"  method="post">
<INPUT type="hidden"  name="clientinfo" ><INPUT type="hidden"  name="cid" >
<p><INPUT type="button" onClick="LicenseDown()" value="Give me the license for the song" ></p>
</form>
</body>
</HTML>

Example Code

' Modified Confirm2.asp 
<HTML>
<HEAD>
<TITLE>V2 Licensing</TITLE>
<Script Language="JavaScript">
function StoreV2License(hr){ 
    var netobj = new GeckoActiveXObject("DRM.GetLicense.1");
    netobj.StoreLicense( "<%= licresponse %>" );
}
</Script>    
</HEAD>
<BODY onLoad="StoreV2License()">

Your license has been delivered!
</BODY>
</HTML>

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.